Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
function createFor(address _owner, SNWProjectMetadata calldata _metadata)
external
override
returns (uint256 projectId) { ... }/**
@notice
The metadata for each project, which can be used across several domains.
_projectId The ID of the project to which the metadata belongs.
_domain The domain within which the metadata applies. Applications can use the domain namespace as they wish.
*/
mapping(uint256 => mapping(uint256 => string)) public override metadataContentOf;
/**
@notice
The number of projects that have been created using this contract.
@dev
The count is incremented with each new project created.
The resulting ERC-721 token ID for each project is the newly incremented count value.
*/
uint256 public override count = 0;
function setMetadataOf(uint256 _projectId, SNWProjectMetadata calldata _metadata)
external
override
requirePermission(ownerOf(_projectId), _projectId, SNOWperations.SET_METADATA) { ... }
// Store the project's new metadata content within the specified domain.
metadataContentOf[_projectId][_metadata.domain] = _metadata.content;
emit SetMetadata(_projectId, _metadata, msg.sender);
/**
@notice
The contract resolving each project ID to its ERC721 URI.
*/
ISnowconeTokenUriResolver public override tokenUriResolver;
constructor(ISnowconeOperatorStore _operatorStore)
ERC721('Snowcone Projects', 'SNOWCONE')
EIP712('Snowcone Projects', '1')
SnowconeOperatable(_operatorStore)
{}
function supportsInterface(bytes4 _interfaceId) public view return
_interfaceId == type(ISnowconeProjects).interfaceId ||
_interfaceId == type(ISnowconeOperatable).interfaceId ||
super.supportsInterface(_interfaceId);
/**
@notice
Indicates if this contract adheres to the specified interface.
@dev
See {IERC165-supportsInterface}.
@param _interfaceId The ID of the interface to check for adherence to.
*/
function supportsInterface(bytes4 _interfaceId)
public
view
virtual
override(IERC165, ERC721)
returns (bool)
{
return
_interfaceId == type(ISnowconeProjects).interfaceId ||
_interfaceId == type(ISnowconeOperatable).interfaceId ||
super.supportsInterface(_interfaceId);
}
function setTokenUriResolver(ISNWTokenUriResolver _newResolver) external override onlyOwner { ... }
/// Store the new resolver.
tokenUriResolver = _newResolver;
emit SetTokenUriResolver(_newResolver, msg.sender);
event SetMetadata(uint256 indexed projectId, SnowconeProjectMetadata metadata, address caller);
event Create(
uint256 indexed projectId,
address indexed owner,
SnowconeProjectMetadata metadata,
address caller
);
event SetTokenUriResolver(ISnowconeTokenUriResolver indexed newResolver, address caller);