Blockwell

Sorare

About

Stats

Public Functions 41
Event Types 6
Code Size 72,606 bytes

Approval Event

Parameters help
owner
address help
approved
address help
tokenId
uint256 help

ApprovalForAll Event

Parameters help
owner
address help
operator
address help
approved
bool help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

RoleGranted Event

Parameters help
role
bytes32 help
account
address help
sender
address help

RoleRevoked Event

Parameters help
role
bytes32 help
account
address help
sender
address help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

Functions Expand All Collapse All

supportsInterface keyboard_arrow_up

Parameters help

Name Type
interfaceId
bytes4 help

Properties

Visibility help public
Mutability help view
Source Code
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

balanceOf keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _holderTokens[owner].length();
    }

ownerOf keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
    }

name keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function name() public view override returns (string memory) {
        return _name;
    }

symbol keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function symbol() public view override returns (string memory) {
        return _symbol;
    }

tokenURI keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];

        // If there is no base URI, return the token URI.
        if (bytes(_baseURI).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(_baseURI, _tokenURI));
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(_baseURI, tokenId.toString()));
    }

baseURI keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function baseURI() public view returns (string memory) {
        return _baseURI;
    }

tokenOfOwnerByIndex keyboard_arrow_up

Parameters help

Name Type
owner
address help
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        return _holderTokens[owner].at(index);
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function totalSupply() public view override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

tokenByIndex keyboard_arrow_up

Parameters help

Name Type
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

approve keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

getApproved keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
operator
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

isApprovedForAll keyboard_arrow_up

Parameters help

Name Type
owner
address help
operator
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isApprovedForAll(address owner, address operator) public view override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function owner() public view returns (address) {
        return _owner;
    }

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

blockRelay keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function blockRelay() public onlyOwner {
        _relayAddress = address(this);
    }

getRelayAddress keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function getRelayAddress() public view returns (address) {
        return _relayAddress;
    }

hasRole keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

getRoleMemberCount keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help

Properties

Visibility help public
Mutability help view
Source Code
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

getRoleMember keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

getRoleAdmin keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help

Properties

Visibility help public
Mutability help view
Source Code
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

grantRole keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

revokeRole keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

renounceRole keyboard_arrow_up

Parameters help

Name Type
role
bytes32 help
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

addMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function addMinter(address account) external {
        grantRole(MINTER_ROLE, account);
    }

renounceMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function renounceMinter(address account) external {
        renounceRole(MINTER_ROLE, account);
    }

revokeMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function revokeMinter(address account) external {
        revokeRole(MINTER_ROLE, account);
    }

setTokenURIPrefix keyboard_arrow_up

Parameters help

Name Type
prefix
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function setTokenURIPrefix(string memory prefix) public onlyOwner {
        _setBaseURI(prefix);
    }

setNextContract keyboard_arrow_up

Parameters help

Name Type
nextContractAddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

UNKNOWN VALUE must be equal to UNKNOWN VALUE
Source Code
    function setNextContract(address nextContractAddress) public onlyOwner {
        require(
            address(nextContract) == address(0),
            "NextContract already set"
        );
        nextContract = INextContract(nextContractAddress);
    }

createCardAndMintToken keyboard_arrow_up

Parameters help

Name Type
playerId
uint256 help
season
uint16 help
scarcity
uint8 help
serialNumber
uint16 help
metadata
bytes32 help
clubId
uint16 help
to
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
    function createCardAndMintToken(
        uint256 playerId,
        uint16 season,
        uint8 scarcity,
        uint16 serialNumber,
        bytes32 metadata,
        uint16 clubId,
        address to
    ) public onlyMinter override returns (uint256) {
        uint256 cardId = sorareCards.createCard(
            playerId,
            season,
            scarcity,
            serialNumber,
            metadata,
            clubId
        );

        _mint(to, cardId);
        return cardId;
    }

mintToken keyboard_arrow_up

Parameters help

Name Type
cardId
uint256 help
to
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
    function mintToken(uint256 cardId, address to)
        public
        override
        onlyMinter
        returns (uint256)
    {
        require(sorareCards.cardExists(cardId), "Card does not exist");

        _mint(to, cardId);
        return cardId;
    }

migrateTokens keyboard_arrow_up

Parameters help

Name Type
tokenIds
uint256[] help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must not be equal to UNKNOWN VALUE
Source Code
    function migrateTokens(uint256[] calldata tokenIds) external {
        require(address(nextContract) != address(0), "Next contract not set");

        for (uint256 index = 0; index < tokenIds.length; index++) {
            transferFrom(_msgSender(), address(this), tokenIds[index]);
        }

        nextContract.migrateTokens(tokenIds, _msgSender());
    }

tokensOfOwner keyboard_arrow_up

Parameters help

Name Type
owner
address help
page
uint8 help
rows
uint8 help

Properties

Visibility help public
Mutability help view
Source Code
    function tokensOfOwner(address owner, uint8 page, uint8 rows)
        public
        view
        returns (uint256[] memory)
    {
        return NFTClient.tokensOfOwner(address(this), owner, page, rows);
    }

getCard keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function getCard(uint256 tokenId)
        public
        view
        returns (
            uint256 playerId,
            uint16 season,
            uint256 scarcity,
            uint16 serialNumber,
            bytes memory metadata,
            uint16 clubId
        )
    {
        (
            playerId,
            season,
            scarcity,
            serialNumber,
            metadata,
            clubId
        ) = sorareCards.getCard(tokenId);
    }

getPlayer keyboard_arrow_up

Parameters help

Name Type
playerId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function getPlayer(uint256 playerId)
        external
        view
        returns (
            string memory name,
            uint16 yearOfBirth,
            uint8 monthOfBirth,
            uint8 dayOfBirth
        )
    {
        (name, yearOfBirth, monthOfBirth, dayOfBirth) = sorareCards.getPlayer(
            playerId
        );
    }

getClub keyboard_arrow_up

Parameters help

Name Type
clubId
uint16 help

Properties

Visibility help public
Mutability help view
Source Code
    function getClub(uint16 clubId)
        external
        view
        returns (
            string memory name,
            string memory country,
            string memory city,
            uint16 yearFounded
        )
    {
        (name, country, city, yearFounded) = sorareCards.getClub(clubId);
    }