Skip to content

Commit

Permalink
stamps: view interface
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Oct 15, 2024
1 parent 6cab2be commit 48720ed
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stamps/interfaces/IStamp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
pragma solidity ^0.8.20;

import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import { IStampView } from "./IStampView.sol";

/// @title IStamp Interface
/// @notice This interface defines the contract for a non-transferable ERC721 token called "Stamp"
/// @dev Inherits from IERC721Enumerable, adding custom functionality for minting and ownership
interface IStamp is IERC721Enumerable {
interface IStamp is IERC721Enumerable, IStampView {
/// @notice Thrown when a user attempts to mint a stamp they already own
/// @param user The address of the user
/// @param stampId The ID of the existing stamp
Expand Down
60 changes: 60 additions & 0 deletions src/stamps/interfaces/IStampView.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IStampView {
enum StampType {
Null,
AccountOwnership,
FollowerSince
}

struct StampData {
address contractAddress;
StampType stampType;
string name;
string symbol;
string platform;
uint256 totalSupply;
}

struct StampUser {
bool owns;
uint256 stampId;
uint256 mintingTimestamp;
}

struct Stamp {
StampData data;
StampUser user;
}

struct FollowerSinceStampData {
StampData stampData;
address followedAccount;
string space;
}

struct FollowerSinceStampUser {
StampUser stampUser;
uint256 followTimestamp;
uint256 timeSinceFollow;
}

struct FollowerSinceStamp {
FollowerSinceStampData data;
FollowerSinceStampUser user;
}

struct AccountOwnershipStamp {
Stamp stamp;
string userUsername;
}

struct StampView {
Stamp[] stamps;
FollowerSinceStamp[] followerSinceStamps;
AccountOwnershipStamp[] accountOwnershipStamps;
}

function getStampView(address user) external view returns (StampView memory);
}

0 comments on commit 48720ed

Please sign in to comment.