BountyData API
Complete API reference for the BountyData contract
Read Methods
MAX_BOUNTY_AMOUNT
Method Signature
function MAX_BOUNTY_AMOUNT() external view returns (uint256)
MIN_BOUNTY_AMOUNT
Method Signature
function MIN_BOUNTY_AMOUNT() external view returns (uint256)
MIN_DEADLINE
Method Signature
function MIN_DEADLINE() external view returns (uint256)
areRewardsClaimed
Method Signature
function areRewardsClaimed(string domainName, uint256 bountyId) external view returns (bool)
bounties
Method Signature
function bounties(string , uint256 ) external view returns (address, address, uint256, uint256, string, string, uint8, uint256, address, uint256, uint256, bool)
bountyContract
Method Signature
function bountyContract() external view returns (address)
bountyCount
Method Signature
function bountyCount(string ) external view returns (uint256)
getBountyCount
Method Signature
function getBountyCount(string domainName) external view returns (uint256)
getBountyParticipants
Gets a list of all participants who submitted work for a bounty
Method Signature
function getBountyParticipants(string domainName, uint256 bountyId) external view returns (tuple[])
Example Response
// Example Response
[
{
submitter: "0x456...",
submissionTime: 1703894400,
isWinner: false,
pendingReward: BigNumber.from("100000000000000000")
}
]
Possible Errors
- BountyNotFound: The specified bounty does not exist
- InvalidDomain: The domain name is invalid
getBountyView
Retrieves detailed information about a specific bounty
Method Signature
function getBountyView(string domainName, uint256 bountyId) external view returns (tuple)
Example Response
// Example Response
{
creator: "0x123...",
title: "Implement Feature X",
description: "Detailed description...",
amount: BigNumber.from("1000000000000000000"),
deadline: 1703980800,
status: 0, // 0: Open, 1: Completed, 2: Cancelled
submissionCount: 3,
winner: "0x0...",
rewardAmount: BigNumber.from("1000000000000000000"),
rewardsClaimed: false
}
Possible Errors
- BountyNotFound: The specified bounty does not exist
- InvalidDomain: The domain name is invalid
getDomainBounties
Returns all bounties created within a specific domain
Method Signature
function getDomainBounties(string domainName) external view returns (tuple[], uint256[])
Example Response
// Example Response
{
bountyViews: [
{
id: 1,
creator: "0x123...",
title: "First Bounty",
// ... other bounty details
}
],
bountyIds: [1, 2, 3]
}
Possible Errors
- InvalidDomain: The domain name is invalid
getDomainStats
Method Signature
function getDomainStats(string domainName) external view returns (tuple)
getGlobalStats
Method Signature
function getGlobalStats() external view returns (uint256, uint256, uint256, uint256, uint256)
getPendingReward
Method Signature
function getPendingReward(string domainName, uint256 bountyId, address user) external view returns (uint256)
getRemainingReward
Method Signature
function getRemainingReward(string domainName, uint256 bountyId) external view returns (uint256)
getSubmissionContent
Method Signature
function getSubmissionContent(string domainName, uint256 bountyId, address submitter) external view returns (string)
getSubmitters
Method Signature
function getSubmitters(string domainName, uint256 bountyId) external view returns (address[])
getUserStats
Method Signature
function getUserStats(address user) external view returns (tuple)
getUserSubmittedBounties
Method Signature
function getUserSubmittedBounties(address user) external view returns (uint256[], string[])
getUserWonBounties
Method Signature
function getUserWonBounties(address user) external view returns (uint256[], string[])
hasSubmitted
Method Signature
function hasSubmitted(string domainName, uint256 bountyId, address user) external view returns (bool)
owner
Method Signature
function owner() external view returns (address)