ReferralSigning

Git Source

State Variables

referredByRegistry

mapping(address referredBy => mapping(address user => bool wasReferred)) public referredByRegistry;

referralsForUserRegistry

mapping(address user => address referredBy) public referralsForUserRegistry;

referralRegistry

mapping(address referredBy => address[] users) public referralRegistry;

totalReferred

mapping(address referredBy => uint256 total) public totalReferred;

isUserReferred

mapping(address user => bool wasReferred) public isUserReferred;

nonces

mapping(address user => uint256 nonce) public nonces;

Functions

onlyNewUser

modifier onlyNewUser();

claimReferral

function claimReferral(bytes calldata signature, address referrer) external onlyNewUser;

Events

ReferralClaimed

event ReferralClaimed(address indexed referred, address indexed referrer);

ReferralRejected

event ReferralRejected(address indexed referred, address indexed referrer, string reason);

Errors

ReferralSigning_SameUser

error ReferralSigning_SameUser();

ReferralSigning_InvalidSignature

error ReferralSigning_InvalidSignature();

ReferralSigning_UserAlreadyReferred

error ReferralSigning_UserAlreadyReferred();

ReferralSigning_ContractReferrerNotAllowed

error ReferralSigning_ContractReferrerNotAllowed();