Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
as3810t committed Nov 3, 2024
1 parent ccb024d commit 15f62c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 894 deletions.
40 changes: 19 additions & 21 deletions .github/scripts/comment.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
module.exports = async ({ github, context, header, body }) => {
const comment = [header, body].join("\n");
const comment = [header, body].join('\n')

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
});
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number
})

const botComment = comments.find(
(comment) =>
// github-actions bot user
comment.user.id === 41898282 && comment.body.startsWith(header)
);
const botComment = comments.find(
(comment) =>
// github-actions bot user
comment.user.id === 41898282 && comment.body.startsWith(header)
)

const commentFn = botComment ? "updateComment" : "createComment";
const commentFn = botComment ? 'updateComment' : 'createComment'

await github.rest.issues[commentFn]({
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
...(botComment
? { comment_id: botComment.id }
: { issue_number: context.payload.number }),
});
};
await github.rest.issues[commentFn]({
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
...(botComment ? { comment_id: botComment.id } : { issue_number: context.payload.number })
})
}
1 change: 1 addition & 0 deletions contracts/MallorysMaliciousMisappropriation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ contract MallorysMaliciousMisappropriation is Ownable {
}

// Receive is called when the contract receives Ether
// solhint-disable-next-line no-complex-fallback
receive() external payable {
// The attack
uint256 withdrawAmount = (nftInvestmentFund.balanceAtEnd() / nftInvestmentFund.fundTokensAtEnd()) * tokenCount;
Expand Down
Loading

0 comments on commit 15f62c6

Please sign in to comment.