DecentrAgora Membership docs
Documentation for DecentrAgora membership contract.
DagoraMembershipsV1
This contract manages the memberships for the Dagora platform.
This contract is upgradeable in order to add new features.
Tiers
Membership
baseURI
Base URI for the token metadata.
isPaused
Boolean to check if the contract is paused.
_isInitialized
Boolean to check if the contract has been initialized.
dagoraTreasury
Address of the dagora treasury.
DAI
Address of the DAI token.
proxyImplementation
Address of the Proxy contract.
ecclesiaPrice
The price of the Ecclesia membership.
ecclesiaRenewPrice
The price of the Ecclesia membership renewal.
dagorianPrice
The price of the dAgorian membership.
dagoraRenewPrice
The price of the dAgorian membership renewal.
hoplitePrice
The price of the Hoplite membership.
hopliteRenewPrice
The price of the Hoplite membership renewal.
percelsiaPrice
The price of the Perclesian membership.
percelsiaRenewPrice
The price of the Perclesian membership renewal.
GRACE_PERIOD
The grace period for renewing a membership.
discount
The discount for renewing a membership for 12 months.
MembershipPurchased
The event emitted when a membership is purchased.
Parameters
FreeMembershipClaimed
The event emitted when a free membership is claimed.
Parameters
MembershipUpgraded
The event emitted when a membership is upgraded.
Parameters
MembershipRenewed
The event emitted when a membership is renewed.
Parameters
MembershipGifted
The event emitted when a membership is claimed.
Parameters
MembershipCanceled
The event emitted when a membership is canceled.
Parameters
DelegateRemoved
The event emitted when a delegate is removed.
Parameters
DelegateAdded
The event emitted when a delegate is added.
Parameters
DelegateSwapped
The event emitted when a delegate is swapped.
Parameters
memberships
mapping that stores the membership details.
experation
mapping that stores a tokenids expiration.
claimed
mapping that sets true if a membership is claimed.
tokenDelegates
mapping that stores the delegates of a tokenId
initialize
The initializer function that replaces the constructor.
Parameters
isNotPaused
Modifier to check if the contract is paused or, not paused.
isNotMember
Modifier to check if the msg.sender has already claimed their membership.
isPerclesian
Modifier to check if the tokenId tier is Perclesian.
_isValidMembership
Modifier to check if the membership is not expired.
durationCheck
Modifier to check if the duration is valid.
duration must be greater than 0 and less than 12 months.
onlyController
Modifier to check if the msg.sender is the owner of the membership.
onlyDelegateeAndOwner
Modifier to check if the msg.sender is the owner or delegatee of the membership.
mintMembership
Function to mint a membership.
The permit signature is used to transfer the DAI from the msg.sender to the dAgoraTreasury.
Parameters
freeMint
Function to claim a ecclesia membership.
renewMembership
Function to Renew a membership.
The permit signature is used to transfer the DAI from the msg.sender to the dAgoraTreasury.
Parameters
upgradeMembership
Function to upgrade a membership.
The permit signature is used to transfer the DAI from the msg.sender to the dAgoraTreasury.
Parameters
cancelMembership
Function to cancel a membership.
Parameters
addDelegate
Function to add a delegate to a membership.
Parameters
removeDelegate
Function to remove a delegate from a membership.
Parameters
swapDelegate
Function to swap a delegate from a membership.
Parameters
giftMembership
only owner function to gift membership to an address, that address must not already have a membership.
Parameters
giftUpgrade
only owner function to gift a upgrade to an existing membership.
Parameters
giftExtension
only owner function to gift a extension to an existing membership.
Parameters
togglePaused
Function to pause the contract.
Only owner can call this function.
setBaseURI
Function to set the baseURI.
Only owner can call this function.
setDiscount
Function to set the Discount price.
Only owner can call this function.
setPercelsiaPrice
Function to set the price of a Percelsia tier membership.
Only owner can call this function.
setHoplitePrice
Function to set the price of a Hoplite tier membership.
Only owner can call this function.
setDagorianPrice
Function to set the price of a Dagorian tier membership.
Only owner can call this function.
setEcclesiaPrice
Function to set the price of a Ecclesia tier membership.
Only owner can call this function.
setPercelsiaRenewPrice
Function to set the price of a Percelsia tier membership renewal.
Only owner can call this function.
setHopliteRenewPrice
Function to set the price of a Hoplite tier membership renewal.
Only owner can call this function.
setDagorianRenewPrice
Function to set the price of a Dagorian tier membership renewal.
Only owner can call this function.
setDagoraTreasury
Function to set the price of a Ecclesia tier membership renewal.
Only owner can call this function.
setProxyAddress
Function to set the address of the proxy contract.
Only owner can call this function.
Parameters
withdrawERC20
Function to withdraw ERC20 tokens from the contract.
Only owner can call this function.
withdrawETH
Function to withdraw ETH from the contract.
Only owner can call this function.
getMembership
Function to get a tokenId membership details.
Parameters
Return Values
getMembershipTier
Function to get a tokenId membership tier.
Parameters
Return Values
getExpiration
Function to get a tokenId membership expiration.
Parameters
Return Values
isValidMembership
Function to get a tokenId membership expiration.
Parameters
Return Values
addressTokenIds
getTokenDelegates
Function to get a tokenIds delegates.
Parameters
Return Values
isOwnerOrDelegate
Function to check is a address is a owner or delegate of a tokenid
Parameters
Return Values
getMintPrice
Function to get the mint price of a membership
Parameters
Return Values
_getUpgradePrice
Function to get the upgrade price of a membership
Parameters
Return Values
getRenewalPrice
Function to get the renewal price of a membership
Parameters
Return Values
tokenURI
Returns a tokenIds URI.
Parameters
Return Values
_isDelegatee
Internal function to check if an address is a delegate of a specfic tokenId.
This function is used in the isOwnerOrDelegate function.
Parameters
Return Values
_startTokenId
Internal function to set the starting tokenId.
Return Values
_getNextTokenId
Internal function to get the next tokenId
Return Values
_beforeTokenTransfers
Internal override function to enable soulbound memberships.
if sender is not address(0), then transfer is not allowed.
Parameters
_contains
Internal function to check if an address is a contained in a specfic tokenId.
This function is used in the isOwnerOrDelegate function.
Parameters
Return Values
Last updated