Contract 0x90958D4531258ca11D18396d4174a007edBc2b42 1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x3d807300383afbf8dc3db9c6a7f24164a33c68c13ec797b385ef315ac51b39e20x60806040225133062021-12-14 12:24:51294 days 11 hrs ago0x1fbf26781e289883a1ec8da235f7159b455d1160 IN  Create: RoyaltiesManager0 MATIC0.0101105430
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RoyaltiesManager

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 2 : RoyaltiesManager.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;


import '../interfaces/IERC721CollectionV2.sol';


contract RoyaltiesManager{

  constructor() {}

  /**
    * @notice Get the royalties receiver for an specific token
    * @dev It tries to get the item beneficiary. If it is the ZERO address, will try to get the creator
    * @param _contractAddress - contract address
    * @param _tokenId - token id
    * @return royaltiesReceiver - address of the royalties receiver
    */
  function getRoyaltiesReceiver(address _contractAddress, uint256 _tokenId) external view returns(address royaltiesReceiver) {
    bool success;
    bytes memory res;

    (success, res) = _contractAddress.staticcall(
        abi.encodeWithSelector(
            IERC721CollectionV2(_contractAddress).decodeTokenId.selector,
            _tokenId
        )
    );

    if (!success) {
      return royaltiesReceiver;
    }

    (uint256 itemId,) = abi.decode(res, (uint256, uint256));

    (success, res) = _contractAddress.staticcall(
        abi.encodeWithSelector(
            IERC721CollectionV2(_contractAddress).items.selector,
            itemId
        )
    );

    if (success) {
      // Get item beneficiary
      (,,,,royaltiesReceiver,,) = abi.decode(res, (string, uint256, uint256, uint256, address, string, string));
    }

    if (royaltiesReceiver == address(0)) {
      // If still the zero address, use the creator
       (success, res) = _contractAddress.staticcall(
        abi.encodeWithSelector(
            IERC721CollectionV2(_contractAddress).creator.selector
        ));

        if (!success) {
          return royaltiesReceiver;
        }

        royaltiesReceiver = abi.decode(res, (address));
    }

    return royaltiesReceiver;
  }
}

File 2 of 2 : IERC721CollectionV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;
pragma experimental ABIEncoderV2;


interface IERC721CollectionV2 {
    function creator() external view returns (address);
    function decodeTokenId(uint256 _tokenId) external view returns (uint256, uint256);
    function items(uint256 _itemId) external view returns (string memory, uint256, uint256, uint256, address, string memory, string memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getRoyaltiesReceiver","outputs":[{"internalType":"address","name":"royaltiesReceiver","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610522806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063cca1d0b714610030575b600080fd5b61004361003e3660046102d7565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b6000806060846001600160a01b0316637efd911260e01b8560405160240161008991815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516100c79190610333565b600060405180830381855afa9150503d8060008114610102576040519150601f19603f3d011682016040523d82523d6000602084013e610107565b606091505b509092509050816101195750506102b9565b60008180602001905181019061012f919061034f565b509050856001600160a01b031663bfb231d260e01b8260405160240161015791815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516101959190610333565b600060405180830381855afa9150503d80600081146101d0576040519150601f19603f3d011682016040523d82523d6000602084013e6101d5565b606091505b50909350915082156101ff57818060200190518101906101f59190610410565b5090985050505050505b6001600160a01b0384166102b55760408051600481526024810182526020810180516001600160e01b03166302d05d3f60e01b17905290516001600160a01b0388169161024b91610333565b600060405180830381855afa9150503d8060008114610286576040519150601f19603f3d011682016040523d82523d6000602084013e61028b565b606091505b5090935091508261029e575050506102b9565b818060200190518101906102b291906104c8565b93505b5050505b92915050565b6001600160a01b03811681146102d457600080fd5b50565b600080604083850312156102ea57600080fd5b82356102f5816102bf565b946020939093013593505050565b60005b8381101561031e578181015183820152602001610306565b8381111561032d576000848401525b50505050565b60008251610345818460208701610303565b9190910192915050565b6000806040838503121561036257600080fd5b505080516020909101519092909150565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261039a57600080fd5b81516001600160401b03808211156103b4576103b4610373565b604051601f8301601f19908116603f011681019082821181831017156103dc576103dc610373565b816040528381528660208588010111156103f557600080fd5b610406846020830160208901610303565b9695505050505050565b600080600080600080600060e0888a03121561042b57600080fd5b87516001600160401b038082111561044257600080fd5b61044e8b838c01610389565b985060208a0151975060408a0151965060608a0151955060808a01519150610475826102bf565b60a08a01519194508082111561048a57600080fd5b6104968b838c01610389565b935060c08a01519150808211156104ac57600080fd5b506104b98a828b01610389565b91505092959891949750929550565b6000602082840312156104da57600080fd5b81516104e5816102bf565b939250505056fea264697066735822122051768871e56106cd22d8ddecad049b4f6b78fa8571c847c5ae36d685a85b7fed64736f6c634300080a0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.