Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 189 additions & 89 deletions packages/contracts/contracts/consent/Consent.sol

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contracts/contracts/consent/ConsentFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ contract ConsentFactory is Initializable, PausableUpgradeable, AccessControlEnum
require(_newSlot > 0, "ConsentFactory: _newSlot must be greater than 0");
require(_newSlot > _existingSlot, "ConsentFactory: _newSlot must be greater than _existingSlot");

// The new listing must fit between _upstream and its current downstresam
// if the next variable is 0, it means the slot is uninitialized and thus it is invalid _upstream entry
// The new listing must fit between _upstream and its current downstream
// if the previous variable is 0, it means the slot is uninitialized and thus it is invalid _upstream entry
bytes32 LLKey = keccak256(abi.encodePacked(tag));
Listing memory existingListing = listings[LLKey][_existingSlot];
require(existingListing.previous > _newSlot, "ConsentFactory: _newSlot is greater than existingListing.previous");
Expand Down
44 changes: 33 additions & 11 deletions packages/contracts/contracts/consent/IConsent.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@ interface IConsent {
address staker; // address which staked the specific tag
}

// helper struct to retrieve nearly all registry details in one http request
struct RegistryDetails{
string name;
string desc;
string imgURL;
string baseURI;
uint maxCapacity;
uint totalSupply;
bool openOptInDisabled;
uint queryHorizon;
string[] domains;
Tag[] tags;
uint256 tokenId;
}

/* EVENTS */

/// @notice Emitted when a request for data is made
/// @dev The SDQL services listens for this event
/// @dev The data wallet client subscribes to this event
/// @param requester Indexed address of data requester
/// @param ipfsCIDIndexed The indexed IPFS CID pointing to an SDQL instruction
/// @param ipfsCID The IPFS CID pointing to an SDQL instruction
Expand All @@ -34,6 +49,10 @@ interface IConsent {

/* External Functions */

function getRegistryDetails() external view returns(RegistryDetails memory);

function updateConsentRegistryDetails(string calldata _name, string calldata _desc, string calldata _img) external;

function tagIndices(string calldata) external view returns(uint256);

function baseURI() external view returns(string memory);
Expand All @@ -42,8 +61,6 @@ interface IConsent {

function openOptInDisabled() external view returns(bool);

function trustedForwarder() external view returns(address);

function queryHorizon() external view returns(uint);

function agreementFlagsArray(uint256) external view returns(bytes32);
Expand All @@ -54,34 +71,41 @@ interface IConsent {

function getTagArray() external view returns (Tag[] memory);

function getDomains() external view returns (string[] memory);

// ranking engine functions
function newGlobalTag(string memory tag, uint256 _newSlot) external;

function newLocalTagUpstream(string memory tag, uint256 _newSlot, uint256 _existingSlot) external;

function newLocalTagDownstream(string memory tag, uint256 _existingSlot, uint256 _newSlot) external;

function moveExistingListingUpstream(string memory tag, uint256 _newSlot, uint256 _existingSlot) external;

function restakeExpiredListing(string memory tag) external;

function replaceExpiredListing(string memory tag, uint256 _slot) external;

function removeListing(string memory tag) external returns (string memory);

function optIn(uint256 tokenId, bytes32 agreementFlags) external;
// Opt-in and Opt-out methods & query methods
function optIn(uint256 tokenId, bytes32 agreementFlags, bytes32 identityCommitment, bytes memory stealthSignature) external;

function restrictedOptIn(uint256 tokenId, bytes32 agreementFlags, bytes memory signature) external;
function restrictedOptIn(uint256 tokenId, bytes32 agreementFlags, bytes32 identityCommitment, bytes memory stealthSignature, bytes memory signature) external;

function anonymousRestrictedOptIn(uint256 tokenId, bytes32 agreementFlags, bytes memory signature) external;
function anonymousRestrictedOptIn(uint256 tokenId, bytes32 agreementFlags, bytes32 identityCommitment, bytes memory stealthSignature, bytes memory signature) external;

function optOut(uint256 tokenId) external;

function requestForData(string memory ipfsCID) external;

// parameter updating functions
function updateMaxCapacity(uint _maxCapacity) external;

function updateAgreementFlags(uint256 tokenId, bytes32 newAgreementFlags) external;

function setQueryHorizon(uint queryHorizon_) external;

function updateTrustedForwarder() external;

function updateMaxTagsLimit() external;

function setBaseURI(string memory newURI) external;
Expand All @@ -96,7 +120,5 @@ interface IConsent {

function disableOpenOptIn() external;

function enableOpenOptIn() external;

function getDomains() external view returns (string[] memory);
function enableOpenOptIn() external;
}
4 changes: 2 additions & 2 deletions packages/contracts/contracts/consent/IConsentFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ interface IConsentFactory {

/// @dev Listing object for storing marketplace listings
struct Listing{
uint256 previous; // pointer to the previous active slot
uint256 next; // pointer to the next active slot
uint256 previous; // pointer to the higher value active slot
uint256 next; // pointer to the next lower value active slot
address consentContract; // address of the target consent contract
uint256 timeExpiring; // unix timestamp when the listing expires and can be replaced
}
Expand Down

This file was deleted.

199 changes: 0 additions & 199 deletions packages/contracts/contracts/registry/Crumbs.sol

This file was deleted.

8 changes: 0 additions & 8 deletions packages/contracts/contracts/registry/README.md

This file was deleted.

Loading