InviteRegistry

Inherits: IReferralSource

Invite codes and referral weights.

Deployed once per chain; shared across all auctions (keyed by auction address). Authority for bid gating + fee attribution (offchain DB is UX-only):

  • Factory registers each auction and seeds creator invite codes (bytes32 → issuer).
  • InviteValidationHook calls useInvite on first CCA bid; unknown/self invites revert.
  • Codes are reusable; only the first participation per bidder credits the issuer.
  • Creator or prior participants may createInvites; FeeDistributor reads referral counts.

State Variables

factory

CcaLaunchFactory — only caller allowed to registerAuction / seedInvites.

address public factory

validationHook

address public validationHook

creatorOf

mapping(address => address) public creatorOf

auctionOfToken

mapping(address => address) public auctionOfToken

inviteIssuer

mapping(address => mapping(bytes32 => address)) public inviteIssuer

participated

mapping(address => mapping(address => bool)) public participated

referralCountOf

mapping(address => mapping(address => uint256)) public referralCountOf

totalReferralCountOf

mapping(address => uint256) public totalReferralCountOf

invitesCreated

mapping(address => uint256) public invitesCreated

Functions

setFactory

function setFactory(address factory_) external;

setValidationHook

function setValidationHook(address hook_) external;

registerAuction

function registerAuction(address auction, address token, address creator) external;

seedInvites

function seedInvites(address auction, address issuer, bytes32[] calldata codes) external;

createInvites

function createInvites(address auction, bytes32[] calldata codes) external;

_createInvites

function _createInvites(address auction, address issuer, bytes32[] calldata codes) internal;

useInvite

Called by InviteValidationHook during CCA submitBid.

function useInvite(address auction, address bidder, bytes32 code) external;

referralCount

function referralCount(address auction, address referrer) external view returns (uint256);

totalReferralCount

function totalReferralCount(address auction) external view returns (uint256);

Events

FactorySet

event FactorySet(address indexed factory);

ValidationHookSet

event ValidationHookSet(address indexed hook);

AuctionRegistered

event AuctionRegistered(address indexed auction, address indexed token, address indexed creator);

InviteCreated

event InviteCreated(address indexed auction, bytes32 indexed code, address indexed issuer);

InviteUsed

event InviteUsed(address indexed auction, address indexed bidder, address indexed referrer, bytes32 code);

Errors

AlreadySet

error AlreadySet();

NotAuthorized

error NotAuthorized();

InvalidInvite

error InvalidInvite();

InviteExists

error InviteExists();

ZeroAddress

error ZeroAddress();