-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or requestfrontendhacktoberfesthelp wantedExtra attention is neededExtra attention is neededsmart-contract
Description
We have the option to create teams currently but don't support team names. We didnt deem this necessary initially but with #120, a team name would be nice to display on the leaderboard.
Contract changes
- Add a field in the struct Team to store the team name in the Khoj contract.
struct Team {
address owner;
uint256 huntId;
// TODO: Add a name
uint256 memberCount;
...
}- Also add it to TeamInfo and functions where team is created / queried for like
createTeam. No checks on whether the team name has already been taken. It will simply be set. - Update the tests in Khoj.test.js to assert for successful team name creation.
Contract will have to be deployed here to integrate with the frontend.
Backend changes
- The attestation structure will also have to be updated in sign-protocol.js to include a teamName string field.
- Accept this as an input in the
attest-clueendpoint.
Front-end changes
- Add an input box above the button
Create Team & Generate Invitein HuntDetails.tsx to take the team name input. Make this field mandatory and max 20 characters. Pass this along with the huntId in HuntDetails while calling thecreateTeamfunction in the contract.
const transaction = prepareContractCall({
contract: {
address: contractAddress as `0x${string}`,
abi: huntABI,
chain: currentChain,
client,
},
method: "createTeam",
params: [BigInt(huntId || 0)], // TODO: Add here
});- Show this team name next to
Your Teamin HuntDetails.tsx. - Use this team name (with ellipses for big team names) on Leaderboard.tsx
- While creating the attestation, pass the teamName also. If its an individual user, pass their address. We can now always show the teamName field from the attestation.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfrontendhacktoberfesthelp wantedExtra attention is neededExtra attention is neededsmart-contract