Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RoyaltyFeeManager
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 888888 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IERC165, IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; import {IRoyaltyFeeManager} from "./interfaces/IRoyaltyFeeManager.sol"; import {IRoyaltyFeeRegistry} from "./interfaces/IRoyaltyFeeRegistry.sol"; /** * @title RoyaltyFeeManager * @notice It handles the logic to check and transfer royalty fees (if any). */ contract RoyaltyFeeManager is IRoyaltyFeeManager, Ownable { // https://eips.ethereum.org/EIPS/eip-2981 bytes4 public constant INTERFACE_ID_ERC2981 = 0x2a55205a; IRoyaltyFeeRegistry public immutable royaltyFeeRegistry; /** * @notice Constructor * @param _royaltyFeeRegistry address of the RoyaltyFeeRegistry */ 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, uint256) { // 1. Check if there is a royalty info in the system (address receiver, uint256 royaltyAmount) = royaltyFeeRegistry.royaltyInfo(collection, amount); // 2. If the receiver is address(0), fee is null, check if it supports the ERC2981 interface if ((receiver == address(0)) || (royaltyAmount == 0)) { if (IERC165(collection).supportsInterface(INTERFACE_ID_ERC2981)) { (receiver, royaltyAmount) = IERC2981(collection).royaltyInfo(tokenId, amount); } } return (receiver, royaltyAmount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: 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)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // 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 ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // 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); }
{ "optimizer": { "enabled": true, "runs": 888888 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_royaltyFeeRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"INTERFACE_ID_ERC2981","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"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":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyFeeRegistry","outputs":[{"internalType":"contract IRoyaltyFeeRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161083138038061083183398101604081905261002f9161009d565b6100383361004d565b60601b6001600160601b0319166080526100cd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100af57600080fd5b81516001600160a01b03811681146100c657600080fd5b9392505050565b60805160601c61073f6100f26000396000818161012201526103ad015261073f6000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063c16f515611610050578063c16f51561461011d578063f2fde38b14610144578063f4f635fa1461015757600080fd5b8063715018a6146100775780638da5cb5b14610081578063b060dd86146100c5575b600080fd5b61007f610196565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100ec7f2a55205a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016100bc565b61009b7f000000000000000000000000000000000000000000000000000000000000000081565b61007f61015236600461063e565b610228565b61016a610165366004610690565b610358565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016100bc565b60005473ffffffffffffffffffffffffffffffffffffffff16331461021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61022660006105c9565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610213565b73ffffffffffffffffffffffffffffffffffffffff811661034c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610213565b610355816105c9565b50565b6040517f2782d6c700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018390526000918291829182917f00000000000000000000000000000000000000000000000000000000000000001690632782d6c790604401604080518083038186803b1580156103ee57600080fd5b505afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610662565b909250905073ffffffffffffffffffffffffffffffffffffffff8216158061044c575080155b156105bd576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f2a55205a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8816906301ffc9a79060240160206040518083038186803b1580156104d657600080fd5b505afa1580156104ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050e91906106c5565b156105bd576040517f2a55205a000000000000000000000000000000000000000000000000000000008152600481018790526024810186905273ffffffffffffffffffffffffffffffffffffffff881690632a55205a90604401604080518083038186803b15801561057f57600080fd5b505afa158015610593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b79190610662565b90925090505b90969095509350505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561065057600080fd5b813561065b816106e7565b9392505050565b6000806040838503121561067557600080fd5b8251610680816106e7565b6020939093015192949293505050565b6000806000606084860312156106a557600080fd5b83356106b0816106e7565b95602085013595506040909401359392505050565b6000602082840312156106d757600080fd5b8151801515811461065b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461035557600080fdfea26469706673582212200a2b4967448c7b89ef292d8d9d9f2de4b53e483efe232706fc5dcfc1131eb80964736f6c6343000807003300000000000000000000000055010472a93921a117aad9b055c141060c8d8022
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063c16f515611610050578063c16f51561461011d578063f2fde38b14610144578063f4f635fa1461015757600080fd5b8063715018a6146100775780638da5cb5b14610081578063b060dd86146100c5575b600080fd5b61007f610196565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100ec7f2a55205a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016100bc565b61009b7f00000000000000000000000055010472a93921a117aad9b055c141060c8d802281565b61007f61015236600461063e565b610228565b61016a610165366004610690565b610358565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016100bc565b60005473ffffffffffffffffffffffffffffffffffffffff16331461021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61022660006105c9565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610213565b73ffffffffffffffffffffffffffffffffffffffff811661034c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610213565b610355816105c9565b50565b6040517f2782d6c700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018390526000918291829182917f00000000000000000000000055010472a93921a117aad9b055c141060c8d80221690632782d6c790604401604080518083038186803b1580156103ee57600080fd5b505afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610662565b909250905073ffffffffffffffffffffffffffffffffffffffff8216158061044c575080155b156105bd576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f2a55205a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8816906301ffc9a79060240160206040518083038186803b1580156104d657600080fd5b505afa1580156104ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050e91906106c5565b156105bd576040517f2a55205a000000000000000000000000000000000000000000000000000000008152600481018790526024810186905273ffffffffffffffffffffffffffffffffffffffff881690632a55205a90604401604080518083038186803b15801561057f57600080fd5b505afa158015610593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b79190610662565b90925090505b90969095509350505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561065057600080fd5b813561065b816106e7565b9392505050565b6000806040838503121561067557600080fd5b8251610680816106e7565b6020939093015192949293505050565b6000806000606084860312156106a557600080fd5b83356106b0816106e7565b95602085013595506040909401359392505050565b6000602082840312156106d757600080fd5b8151801515811461065b57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461035557600080fdfea26469706673582212200a2b4967448c7b89ef292d8d9d9f2de4b53e483efe232706fc5dcfc1131eb80964736f6c63430008070033
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
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.