Skip to content

Commit

Permalink
Merge pull request #12 from chain-notes-brussels/finalContract
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
jacksmithinsulander authored Jul 13, 2024
2 parents 8311631 + eccd308 commit 1edda58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions packages/foundry/src/Notes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ contract Notes {
/// @dev The amount of different ratoings for a specific note
mapping(address contractAddress => mapping(uint16 index => mapping(CNDataTypes.Rating rating => uint32 amount))) public amountOfRating;

/// @dev store score info
mapping(address contractAddress => mapping(uint16 index => CNDataTypes.NoteScore scoreInfo)) public scoreInfoOf;

/// @dev The rating weight of a user
mapping(address user => mapping(CNDataTypes.Rating => uint40 amount)) public ratingWeightOf;

Expand All @@ -88,9 +85,9 @@ contract Notes {
*
* @param _useWorldId a boolan if we are using worldcoin id or not
* @param _worldId address of worldå
* @param _appId
* @param _noteId
* @param _voteId
* @param _appId worldcoin app id as string
* @param _noteId worldcoin action id for note
* @param _voteId worldcoin action id for vote
*
*/
constructor(
Expand Down Expand Up @@ -164,7 +161,7 @@ contract Notes {
});

// Notescore variable
CNDataTypes.NoteScore score = CNDataTypes.NoteScore({
CNDataTypes.NoteScore memory score = CNDataTypes.NoteScore({
score: 0,
consideredHelpful: false
});
Expand Down Expand Up @@ -268,7 +265,7 @@ contract Notes {
}

// Set the score info to the note
scoreInfoOf[_contractAddress][_noteIndex] = newScore;
scoresOf[_contractAddress][_noteIndex] = newScore;

// Toggle the voted on note stattus for user
userVotedOnNote[msg.sender][_contractAddress][_noteIndex] = true;
Expand Down Expand Up @@ -325,8 +322,14 @@ contract Notes {
* @return _notes array of notes associated with contract
*
*/
function retrieveContractNotes(address _contractAddress) external view returns (CNDataTypes.Note[] memory _notes) {
function retrieveContractNotes(address _contractAddress) external view returns (
CNDataTypes.Note[] memory _notes,
CNDataTypes.NoteScore[] memory _scores
) {
// retrieve notes
_notes = notesOf[_contractAddress];

// Retrieve score
_scores = scoresOf[_contractAddress];
}
}
2 changes: 1 addition & 1 deletion packages/foundry/src/interfaces/IWorldID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.26;
interface IWorldID {
/// @notice Reverts if the zero-knowledge proof is invalid.
/// @param root The of the Merkle tree
/// @param groupId The id of the Semaphore group
// @param groupId The id of the Semaphore group
/// @param signalHash A keccak256 hash of the Semaphore signal
/// @param nullifierHash The nullifier hash
/// @param externalNullifierHash A keccak256 hash of the external nullifier
Expand Down

0 comments on commit 1edda58

Please sign in to comment.