Skip to content

Commit

Permalink
Merge pull request #447 from ArtBlocks/refactor-v3-core-interfaces
Browse files Browse the repository at this point in the history
Use common V3 core base interface
  • Loading branch information
ryley-o authored Jan 13, 2023
2 parents aef231c + a06f7d5 commit 042b293
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 230 deletions.
2 changes: 1 addition & 1 deletion contracts/GenArt721CoreV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ contract GenArt721CoreV3 is
function owner()
public
view
override(Ownable, IGenArt721CoreContractV3)
override(Ownable, IGenArt721CoreContractV3_Base)
returns (address)
{
return Ownable.owner();
Expand Down
2 changes: 1 addition & 1 deletion contracts/GenArt721CoreV3_Engine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ contract GenArt721CoreV3_Engine is
function owner()
public
view
override(Ownable, IGenArt721CoreContractV3_Engine)
override(Ownable, IGenArt721CoreContractV3_Base)
returns (address)
{
return Ownable.owner();
Expand Down
2 changes: 1 addition & 1 deletion contracts/explorations/GenArt721CoreV3_Explorations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ contract GenArt721CoreV3_Explorations is
function owner()
public
view
override(Ownable, IGenArt721CoreContractV3)
override(Ownable, IGenArt721CoreContractV3_Base)
returns (address)
{
return Ownable.owner();
Expand Down
124 changes: 10 additions & 114 deletions contracts/interfaces/0.8.x/IGenArt721CoreContractV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,16 @@
pragma solidity ^0.8.0;

import "./IAdminACLV0.sol";
/// use the Royalty Registry's IManifold interface for token royalties
import "./IManifold.sol";

interface IGenArt721CoreContractV3 is IManifold {
/**
* @notice Token ID `_tokenId` minted to `_to`.
*/
event Mint(address indexed _to, uint256 indexed _tokenId);

/**
* @notice currentMinter updated to `_currentMinter`.
* @dev Implemented starting with V3 core
*/
event MinterUpdated(address indexed _currentMinter);

/**
* @notice Platform updated on bytes32-encoded field `_field`.
*/
event PlatformUpdated(bytes32 indexed _field);

/**
* @notice Project ID `_projectId` updated on bytes32-encoded field
* `_update`.
*/
event ProjectUpdated(uint256 indexed _projectId, bytes32 indexed _update);

event ProposedArtistAddressesAndSplits(
uint256 indexed _projectId,
address _artistAddress,
address _additionalPayeePrimarySales,
uint256 _additionalPayeePrimarySalesPercentage,
address _additionalPayeeSecondarySales,
uint256 _additionalPayeeSecondarySalesPercentage
);

event AcceptedArtistAddressesAndSplits(uint256 indexed _projectId);

// version and type of the core contract
// coreVersion is a string of the form "0.x.y"
function coreVersion() external view returns (string memory);

// coreType is a string of the form "GenArt721CoreV3"
function coreType() external view returns (string memory);

// owner (pre-V3 was named admin) of contract
// this is expected to be an Admin ACL contract for V3
function owner() external view returns (address);

// Admin ACL contract for V3, will be at the address owner()
function adminACLContract() external returns (IAdminACLV0);

// backwards-compatible (pre-V3) admin - equal to owner()
function admin() external view returns (address);

/**
* Function determining if _sender is allowed to call function with
* selector _selector on contract `_contract`. Intended to be used with
* peripheral contracts such as minters, as well as internally by the
* core contract itself.
*/
function adminACLAllowed(
address _sender,
address _contract,
bytes4 _selector
) external returns (bool);

// getter function of public variable
function nextProjectId() external view returns (uint256);

// getter function of public mapping
function tokenIdToProjectId(
uint256 tokenId
) external view returns (uint256 projectId);

// @dev this is not available in V0
function isMintWhitelisted(address minter) external view returns (bool);

function projectIdToArtistAddress(
uint256 _projectId
) external view returns (address payable);

function projectIdToAdditionalPayeePrimarySales(
uint256 _projectId
) external view returns (address payable);

function projectIdToAdditionalPayeePrimarySalesPercentage(
uint256 _projectId
) external view returns (uint256);

import "./IGenArt721CoreContractV3_Base.sol";

/**
* @title This interface extends IGenArt721CoreContractV3_Base with functions
* that are part of the Art Blocks Flagship core contract.
* @author Art Blocks Inc.
*/
// This interface extends IGenArt721CoreContractV3_Base with functions that are
// in part of the Art Blocks Flagship core contract.
interface IGenArt721CoreContractV3 is IGenArt721CoreContractV3_Base {
// @dev new function in V3
function getPrimaryRevenueSplits(
uint256 _projectId,
Expand All @@ -109,21 +30,6 @@ interface IGenArt721CoreContractV3 is IManifold {
address payable additionalPayeePrimaryAddress_
);

// @dev new function in V3
function projectStateData(
uint256 _projectId
)
external
view
returns (
uint256 invocations,
uint256 maxInvocations,
bool active,
bool paused,
uint256 completedTimestamp,
bool locked
);

// @dev Art Blocks primary sales payment address
function artblocksPrimarySalesAddress()
external
Expand Down Expand Up @@ -154,16 +60,6 @@ interface IGenArt721CoreContractV3 is IManifold {
// @dev Basis points of secondary sales allocated to Art Blocks
function artblocksSecondarySalesBPS() external view returns (uint256);

// function to set a token's hash (must be guarded)
function setTokenHash_8PT(uint256 _tokenId, bytes32 _hash) external;

// @dev gas-optimized signature in V3 for `mint`
function mint_Ecf(
address _to,
uint256 _projectId,
address _by
) external returns (uint256 tokenId);

/**
* @notice Backwards-compatible (pre-V3) function that gets artist +
* artist's additional payee royalty data for token ID `_tokenId`.
Expand Down
127 changes: 127 additions & 0 deletions contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.

pragma solidity ^0.8.0;

import "./IAdminACLV0.sol";
/// use the Royalty Registry's IManifold interface for token royalties
import "./IManifold.sol";

/**
* @title This interface is intended to house interface items that are common
* across all GenArt721CoreContractV3 flagship and derivative implementations.
* This interface extends the IManifold royalty interface in order to
* add support the Royalty Registry by default.
* @author Art Blocks Inc.
*/
interface IGenArt721CoreContractV3_Base is IManifold {
/**
* @notice Token ID `_tokenId` minted to `_to`.
*/
event Mint(address indexed _to, uint256 indexed _tokenId);

/**
* @notice currentMinter updated to `_currentMinter`.
* @dev Implemented starting with V3 core
*/
event MinterUpdated(address indexed _currentMinter);

/**
* @notice Platform updated on bytes32-encoded field `_field`.
*/
event PlatformUpdated(bytes32 indexed _field);

/**
* @notice Project ID `_projectId` updated on bytes32-encoded field
* `_update`.
*/
event ProjectUpdated(uint256 indexed _projectId, bytes32 indexed _update);

event ProposedArtistAddressesAndSplits(
uint256 indexed _projectId,
address _artistAddress,
address _additionalPayeePrimarySales,
uint256 _additionalPayeePrimarySalesPercentage,
address _additionalPayeeSecondarySales,
uint256 _additionalPayeeSecondarySalesPercentage
);

event AcceptedArtistAddressesAndSplits(uint256 indexed _projectId);

// version and type of the core contract
// coreVersion is a string of the form "0.x.y"
function coreVersion() external view returns (string memory);

// coreType is a string of the form "GenArt721CoreV3"
function coreType() external view returns (string memory);

// owner (pre-V3 was named admin) of contract
// this is expected to be an Admin ACL contract for V3
function owner() external view returns (address);

// Admin ACL contract for V3, will be at the address owner()
function adminACLContract() external returns (IAdminACLV0);

// backwards-compatible (pre-V3) admin - equal to owner()
function admin() external view returns (address);

/**
* Function determining if _sender is allowed to call function with
* selector _selector on contract `_contract`. Intended to be used with
* peripheral contracts such as minters, as well as internally by the
* core contract itself.
*/
function adminACLAllowed(
address _sender,
address _contract,
bytes4 _selector
) external returns (bool);

// getter function of public variable
function nextProjectId() external view returns (uint256);

// getter function of public mapping
function tokenIdToProjectId(
uint256 tokenId
) external view returns (uint256 projectId);

// @dev this is not available in V0
function isMintWhitelisted(address minter) external view returns (bool);

function projectIdToArtistAddress(
uint256 _projectId
) external view returns (address payable);

function projectIdToAdditionalPayeePrimarySales(
uint256 _projectId
) external view returns (address payable);

function projectIdToAdditionalPayeePrimarySalesPercentage(
uint256 _projectId
) external view returns (uint256);

// @dev new function in V3
function projectStateData(
uint256 _projectId
)
external
view
returns (
uint256 invocations,
uint256 maxInvocations,
bool active,
bool paused,
uint256 completedTimestamp,
bool locked
);

// function to set a token's hash (must be guarded)
function setTokenHash_8PT(uint256 _tokenId, bytes32 _hash) external;

// @dev gas-optimized signature in V3 for `mint`
function mint_Ecf(
address _to,
uint256 _projectId,
address _by
) external returns (uint256 tokenId);
}
Loading

0 comments on commit 042b293

Please sign in to comment.