Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Sponsored
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 14736745 | 577 days 23 hrs ago | IN | Create: RoyaltyRegisterHub | 0 ETH | 0.01641431 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RoyaltyRegisterHub
Compiler Version
v0.4.26+commit.4563c3fc
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2022-05-24 */ // File: contracts/Ownable.sol pragma solidity 0.4.26; contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } // File: contracts/IRoyaltyRegisterHub.sol pragma solidity 0.4.26; /// /// @dev Interface for the NFT Royalty Standard /// interface IRoyaltyRegisterHub { /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _nftAddress - the NFT contract address /// @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(address _nftAddress, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: contracts/RoyaltyRegisterHub.sol pragma solidity 0.4.26; interface IOwnable { function owner() external view returns (address); } contract RoyaltyRegisterHub is IRoyaltyRegisterHub, Ownable { /* Inverse basis point. */ uint public constant INVERSE_BASIS_POINT = 10000; uint public constant MAXIMUM_ROYALTY_RATE = 1000; bytes4 private constant OWNER_SELECTOR = 0x8da5cb5b; // owner() /* nft royalty rate, in basis points. */ mapping(address => uint) public nftRoyaltyRateMap; /* nft royalty receiver */ mapping(address => address) public nftRoyaltyReceiverMap; constructor() public { } function setRoyaltyRate(address _nftAddress, uint256 _royaltyRate, address _receiver) public onlyOwner returns (bool) { require(_royaltyRate<MAXIMUM_ROYALTY_RATE, "royalty rate too large"); require(_receiver!=address(0x0), "invalid royalty receiver"); nftRoyaltyRateMap[_nftAddress] = _royaltyRate; nftRoyaltyReceiverMap[_nftAddress] = _receiver; return true; } function setRoyaltyRateFromNFTOwners(address _nftAddress, uint256 _royaltyRate, address _receiver) public returns (bool) { require(_royaltyRate<MAXIMUM_ROYALTY_RATE, "royaltyRate too large"); require(_receiver!=address(0x0), "invalid royalty receiver"); bool success; bytes memory data = abi.encodeWithSelector(OWNER_SELECTOR); bytes memory result = new bytes(32); assembly { success := call( gas, // gas remaining _nftAddress, // destination address 0, // no ether add(data, 32), // input buffer (starts after the first 32 bytes in the `data` array) mload(data), // input length (loaded from the first 32 bytes in the `data` array) result, // output buffer 32 // output length ) } require(success, "no owner method"); address owner; assembly { owner := mload(result) } require(msg.sender == owner, "not authorized"); nftRoyaltyRateMap[_nftAddress] = _royaltyRate; nftRoyaltyReceiverMap[_nftAddress] = _receiver; return true; } function royaltyInfo(address _nftAddress, uint256 _salePrice) external view returns (address, uint256) { address receiver = nftRoyaltyReceiverMap[_nftAddress]; uint256 royaltyAmount = SafeMath.div(SafeMath.mul(nftRoyaltyRateMap[_nftAddress], _salePrice), INVERSE_BASIS_POINT); return (receiver, royaltyAmount); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"_nftAddress","type":"address"},{"name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_nftAddress","type":"address"},{"name":"_royaltyRate","type":"uint256"},{"name":"_receiver","type":"address"}],"name":"setRoyaltyRate","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAXIMUM_ROYALTY_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"nftRoyaltyReceiverMap","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"INVERSE_BASIS_POINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"nftRoyaltyRateMap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_nftAddress","type":"address"},{"name":"_royaltyRate","type":"uint256"},{"name":"_receiver","type":"address"}],"name":"setRoyaltyRateFromNFTOwners","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b5060008054600160a060020a031916331790556107d3806100326000396000f3006080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632782d6c781146100a8578063715018a6146100ef57806388139db8146101065780638da5cb5b146101455780639808672514610176578063c4203a111461019d578063cae6047f146101be578063e82c66c9146101d3578063eb78fa13146101f4578063f2fde38b1461021f575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a0360043516602435610240565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156100fb57600080fd5b50610104610291565b005b34801561011257600080fd5b50610131600160a060020a0360043581169060243590604435166102fd565b604080519115158252519081900360200190f35b34801561015157600080fd5b5061015a61041a565b60408051600160a060020a039092168252519081900360200190f35b34801561018257600080fd5b5061018b610429565b60408051918252519081900360200190f35b3480156101a957600080fd5b5061015a600160a060020a036004351661042f565b3480156101ca57600080fd5b5061018b61044a565b3480156101df57600080fd5b5061018b600160a060020a0360043516610450565b34801561020057600080fd5b50610131600160a060020a036004358116906024359060443516610462565b34801561022b57600080fd5b50610104600160a060020a03600435166106b7565b600160a060020a0380831660009081526002602090815260408083205460019092528220549192839291169082906102849061027c908761074b565b612710610784565b9196919550909350505050565b600054600160a060020a031633146102a857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60008054600160a060020a0316331461031557600080fd5b6103e8831061036e576040805160e560020a62461bcd02815260206004820152601660248201527f726f79616c7479207261746520746f6f206c6172676500000000000000000000604482015290519081900360640190fd5b600160a060020a03821615156103ce576040805160e560020a62461bcd02815260206004820152601860248201527f696e76616c696420726f79616c74792072656365697665720000000000000000604482015290519081900360640190fd5b50600160a060020a0392831660009081526001602081815260408084209590955560029052929020805473ffffffffffffffffffffffffffffffffffffffff1916919093161790915590565b600054600160a060020a031681565b6103e881565b600260205260009081526040902054600160a060020a031681565b61271081565b60016020526000908152604090205481565b600080606080826103e887106104c2576040805160e560020a62461bcd02815260206004820152601560248201527f726f79616c74795261746520746f6f206c617267650000000000000000000000604482015290519081900360640190fd5b600160a060020a0386161515610522576040805160e560020a62461bcd02815260206004820152601860248201527f696e76616c696420726f79616c74792072656365697665720000000000000000604482015290519081900360640190fd5b6040805160048152602481018252602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8da5cb5b00000000000000000000000000000000000000000000000000000000179052825181815280840190935290945081602001602082028038833901905050915060208284516020860160008c5af19350831515610600576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f206f776e6572206d6574686f640000000000000000000000000000000000604482015290519081900360640190fd5b50805133600160a060020a03821614610663576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f7420617574686f72697a6564000000000000000000000000000000000000604482015290519081900360640190fd5b50505050600160a060020a0393841660009081526001602081815260408084209690965560029052939020805473ffffffffffffffffffffffffffffffffffffffff19169290941691909117909255919050565b600054600160a060020a031633146106ce57600080fd5b600160a060020a03811615156106e357600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008083151561075e576000915061077d565b5082820282848281151561076e57fe5b041461077957600080fd5b8091505b5092915050565b60008080831161079357600080fd5b828481151561079e57fe5b049493505050505600a165627a7a723058206fed100d4f0ad3830b18faeebbe10d6cb46506ac8fdc9c2a3cb27ff7b613f5220029
Deployed Bytecode
0x6080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632782d6c781146100a8578063715018a6146100ef57806388139db8146101065780638da5cb5b146101455780639808672514610176578063c4203a111461019d578063cae6047f146101be578063e82c66c9146101d3578063eb78fa13146101f4578063f2fde38b1461021f575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a0360043516602435610240565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156100fb57600080fd5b50610104610291565b005b34801561011257600080fd5b50610131600160a060020a0360043581169060243590604435166102fd565b604080519115158252519081900360200190f35b34801561015157600080fd5b5061015a61041a565b60408051600160a060020a039092168252519081900360200190f35b34801561018257600080fd5b5061018b610429565b60408051918252519081900360200190f35b3480156101a957600080fd5b5061015a600160a060020a036004351661042f565b3480156101ca57600080fd5b5061018b61044a565b3480156101df57600080fd5b5061018b600160a060020a0360043516610450565b34801561020057600080fd5b50610131600160a060020a036004358116906024359060443516610462565b34801561022b57600080fd5b50610104600160a060020a03600435166106b7565b600160a060020a0380831660009081526002602090815260408083205460019092528220549192839291169082906102849061027c908761074b565b612710610784565b9196919550909350505050565b600054600160a060020a031633146102a857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60008054600160a060020a0316331461031557600080fd5b6103e8831061036e576040805160e560020a62461bcd02815260206004820152601660248201527f726f79616c7479207261746520746f6f206c6172676500000000000000000000604482015290519081900360640190fd5b600160a060020a03821615156103ce576040805160e560020a62461bcd02815260206004820152601860248201527f696e76616c696420726f79616c74792072656365697665720000000000000000604482015290519081900360640190fd5b50600160a060020a0392831660009081526001602081815260408084209590955560029052929020805473ffffffffffffffffffffffffffffffffffffffff1916919093161790915590565b600054600160a060020a031681565b6103e881565b600260205260009081526040902054600160a060020a031681565b61271081565b60016020526000908152604090205481565b600080606080826103e887106104c2576040805160e560020a62461bcd02815260206004820152601560248201527f726f79616c74795261746520746f6f206c617267650000000000000000000000604482015290519081900360640190fd5b600160a060020a0386161515610522576040805160e560020a62461bcd02815260206004820152601860248201527f696e76616c696420726f79616c74792072656365697665720000000000000000604482015290519081900360640190fd5b6040805160048152602481018252602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8da5cb5b00000000000000000000000000000000000000000000000000000000179052825181815280840190935290945081602001602082028038833901905050915060208284516020860160008c5af19350831515610600576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f206f776e6572206d6574686f640000000000000000000000000000000000604482015290519081900360640190fd5b50805133600160a060020a03821614610663576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f7420617574686f72697a6564000000000000000000000000000000000000604482015290519081900360640190fd5b50505050600160a060020a0393841660009081526001602081815260408084209690965560029052939020805473ffffffffffffffffffffffffffffffffffffffff19169290941691909117909255919050565b600054600160a060020a031633146106ce57600080fd5b600160a060020a03811615156106e357600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008083151561075e576000915061077d565b5082820282848281151561076e57fe5b041461077957600080fd5b8091505b5092915050565b60008080831161079357600080fd5b828481151561079e57fe5b049493505050505600a165627a7a723058206fed100d4f0ad3830b18faeebbe10d6cb46506ac8fdc9c2a3cb27ff7b613f5220029
Deployed Bytecode Sourcemap
3903:2557:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6109:346;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6109:346:0;-1:-1:-1;;;;;6109:346:0;;;;;;;;;;;-1:-1:-1;;;;;6109:346:0;;;;;;;;;;;;;;;;;;;;;1126:124;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1126:124:0;;;;;;4425:413;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4425:413:0;-1:-1:-1;;;;;4425:413:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;85:20:0;;;;;;;;-1:-1:-1;;;;;85:20:0;;;;;;;;;;;;;;4059:48;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4059:48:0;;;;;;;;;;;;;;;;;;;;4321:56;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4321:56:0;-1:-1:-1;;;;;4321:56:0;;;;;4004:48;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4004:48:0;;;;4233:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4233:49:0;-1:-1:-1;;;;;4233:49:0;;;;;4846:1255;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4846:1255:0;-1:-1:-1;;;;;4846:1255:0;;;;;;;;;;;;;831:192;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;831:192:0;-1:-1:-1;;;;;831:192:0;;;;;6109:346;-1:-1:-1;;;;;6242:34:0;;;6194:7;6242:34;;;:21;:34;;;;;;;;;;6337:30;;;;;;6194:7;;;;6242:34;;;6194:7;;6311:91;;6324:56;;6369:10;6324:12;:56::i;:::-;4047:5;6311:12;:91::i;:::-;6423:8;;6287:115;;-1:-1:-1;6109:346:0;;-1:-1:-1;;;;6109:346:0:o;1126:124::-;628:5;;-1:-1:-1;;;;;628:5:0;614:10;:19;606:28;;;;;;1207:5;;;1188:25;;-1:-1:-1;;;;;1207:5:0;;;;1188:25;;;1240:1;1224:18;;-1:-1:-1;;1224:18:0;;;1126:124::o;4425:413::-;4537:4;628:5;;-1:-1:-1;;;;;628:5:0;614:10;:19;606:28;;;;;;4103:4;4562:33;;4554:68;;;;;-1:-1:-1;;;;;4554:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4641:23:0;;;;4633:60;;;;;-1:-1:-1;;;;;4633:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4706:30:0;;;;;;;:17;:30;;;;;;;;:45;;;;4762:21;:34;;;;;:46;;-1:-1:-1;;4762:46:0;;;;;;;;;4706:17;4425:413::o;85:20::-;;;-1:-1:-1;;;;;85:20:0;;:::o;4059:48::-;4103:4;4059:48;:::o;4321:56::-;;;;;;;;;;;;-1:-1:-1;;;;;4321:56:0;;:::o;4004:48::-;4047:5;4004:48;:::o;4233:49::-;;;;;;;;;;;;;:::o;4846:1255::-;4961:4;;5152:17;;4961:4;4103;4986:33;;4978:67;;;;;-1:-1:-1;;;;;4978:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5064:23:0;;;;5056:60;;;;;-1:-1:-1;;;;;5056:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5172:38;;;22:32:-1;6:49;;5172:38:0;;;;;49:4:-1;25:18;;;61:17;;5172:38:0;182:15:-1;5195:14:0;179:29:-1;160:49;;5243:13:0;;;;;;;;;;;5172:38;;-1:-1:-1;5243:13:0;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;5243:13:0;5221:35;;5705:2;5659:6;5567:4;5561:11;5472:2;5466:4;5462:13;5421:1;5367:11;5321:3;5302:450;5291:461;;5781:7;5773:35;;;;;;;-1:-1:-1;;;;;5773:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5876:13:0;;5918:10;-1:-1:-1;;;;;5918:19:0;;;5910:46;;;;;-1:-1:-1;;;;;5910:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;5969:30:0;;;;;;;:17;:30;;;;;;;;:45;;;;6025:21;:34;;;;;:46;;-1:-1:-1;;6025:46:0;;;;;;;;;;;;5969:17;4846:1255;-1:-1:-1;4846:1255:0:o;831:192::-;628:5;;-1:-1:-1;;;;;628:5:0;614:10;:19;606:28;;;;;;-1:-1:-1;;;;;912:22:0;;;;904:31;;;;;;972:5;;;951:37;;-1:-1:-1;;;;;951:37:0;;;;972:5;;;951:37;;;999:5;:16;;-1:-1:-1;;999:16:0;-1:-1:-1;;;;;999:16:0;;;;;;;;;;831:192::o;2242:393::-;2300:7;;2528:6;;2524:37;;;2552:1;2545:8;;;;2524:37;-1:-1:-1;2581:5:0;;;2585:1;2581;:5;2601;;;;;;;;:10;2593:19;;;;;;2628:1;2621:8;;2242:393;;;;;;:::o;2750:276::-;2808:7;;2832:5;;;2824:14;;;;;;2919:1;2915;:5;;;;;;;;;2750:276;-1:-1:-1;;;;2750:276:0:o
Swarm Source
bzzr://6fed100d4f0ad3830b18faeebbe10d6cb46506ac8fdc9c2a3cb27ff7b613f522
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.
[ 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.