Smart Contracts
DEGENFUSION: 0xA95f46a4251CbC11F9FB86021cD060C7aD13fdF6
BOUNTY: 0x80d5C4E7A3B2FD6C376b2AB058e0a3d88931962e
TOKEN: 0xe062e38d16d949FFB0bD6b62ae2f7a3c930bE1C4
SOL TOKEN: BfzdNbV6pgLSs7KunQrhPBP1n8BYyF3d3op5xKzf9noK
DEGENFUSION Contract
Core Game Actions
mintTier1(uint256 amountToMint)
Description: Mints new Tier-1 NFTs by burning ERC-20 tokens
Parameters:
amountToMint
: Number of Tier-1 NFTs to mint
Requirements:
User must have sufficient ERC-20 tokens (50 tokens per Tier-1 NFT)
Game must be started
Effects:
Burns ERC-20 tokens from user
Mints Tier-1 NFTs to user
Updates Tier-1 supply
startMerge(uint256 _tier, uint256 pairsToMerge)
Description: Initiates the merging of NFTs of the same tier to attempt upgrading to the next tier
Parameters:
_tier
: The tier of NFTs to mergepairsToMerge
: Number of NFT pairs to merge
Requirements:
Tier must be valid (between 1 and maxTier-1)
User must have sufficient NFTs of the specified tier
For tiers 2+, tier must be unlocked based on time
User must have sufficient tokens for merge fees
Effects:
Burns the specified NFTs from user
Burns tokens for merge fees
Initiates a VRF request for randomness
Registers the merge request
dismantle(uint256 _tier, uint256 amountToDismantle)
Description: Dismantles NFTs of a specified tier to reclaim tokens
Parameters:
_tier
: Tier of NFTs to dismantleamountToDismantle
: Number of NFTs to dismantle
Requirements:
Tier must be valid (between 1 and maxTier)
User must have sufficient NFTs of the specified tier
Effects:
Burns the specified NFTs
Mints tokens to the user based on the dismantle value
reclaimMerge(uint256 requestId)
Description: Reclaims NFTs from a pending merge that hasn't been fulfilled within the timeout period
Parameters:
requestId
: ID of the merge request to reclaim
Requirements:
Merge must not be already fulfilled
User must be the initiator of the merge request
At least 15 minutes must have passed since the merge request
Effects:
Returns the original NFTs to the user
Removes the pending merge request
View Functions
getUnlockTime(uint256 tier)
Description: Returns the timestamp when a specified tier will be unlocked
Parameters:
tier
: The tier to check unlock time for
Returns: Timestamp when the tier will be unlocked
uri(uint256 tierId)
Description: Returns the URI for the metadata of a specific tier
Parameters:
tierId
: The tier ID to get the URI for
Returns: String URI pointing to the metadata JSON
Public State Variables
gameStartTime
: Timestamp when the game startedgameStarted
: Boolean indicating if the game has startedkeyHash
: Hash used for VRFsubId
: Subscription ID for VRFcallbackGasLimit
: Gas limit for VRF callbacksbaseURI
: Base URI for NFT metadatareclaimTimer
: Constant for the time required before reclaiming (15 minutes)tierUnlockTimer
: Constant for the time between tier unlocks (24 hours)tier1Cost
: Constant for the cost of minting Tier-1 NFTs (50 tokens)maxTier
: Constant for the maximum tier (6)mergeFees
: Array of merge fees for each tierdismantleValue
: Array of token values returned when dismantling each tiersupply
: Mapping of current supply for each tierpendingMerges
: Mapping of pending merge requestsrequestTimestamps
: Mapping of timestamps for merge requestslastMergeRequest
: Mapping of the last merge request for each usermergeResults
: Mapping of merge results
Project02BountyV1 Contract
User Actions
claimBounty(uint256 bountyId)
Description: Claims a bounty by transferring the required ERC-1155 tokens
Parameters:
bountyId
: ID of the bounty to claim
Requirements:
setApprovalForAll (operator: 0x80d5C4E7A3B2FD6C376b2AB058e0a3d88931962e, approved: true) must be called on DEGENFUSION contract
Bounty must exist
Bounty must not be already claimed
User must have the required tokens
Effects:
Transfers the specified tokens from user to contract
Marks the bounty as claimed
Sends the reward to the user
View Functions
getBountyDetails(uint256 bountyId)
Description: Returns the details of a specific bounty
Parameters:
bountyId
: ID of the bounty to get details for
Returns:
tokenContract
: Address of the ERC-1155 token contracttokenId
: ID of the required tokenquantity
: Number of tokens requiredreward
: Amount of ETH as rewardavailable
: Boolean indicating if the bounty is still available
getBountyCount()
Description: Returns the total number of bounties
Returns: Total number of bounties created
Public State Variables
admin
: Address of the admin who can create and manage bountiesbounties
: Array of all bounties
Last updated