Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launchpad v2 audit fixes #84

Merged
merged 25 commits into from
Dec 3, 2024
Merged

Launchpad v2 audit fixes #84

merged 25 commits into from
Dec 3, 2024

Conversation

psorinionut
Copy link
Contributor

No description provided.

Comment on lines +199 to +205
fn check_caller_owner_or_user(&self) {
if self.blockchain().get_owner_address() == self.blockchain().get_caller() {
return;
}

self.blockchain().check_caller_is_user_account();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't respect the doc, i.e. or an account from another shard, you just check the caller is a user account.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this was not what was requested, but it is a more simpler and clear/cleaner solution. which covers the initial request. No need for external SCs to call this function.

launchpad-common/src/winner_selection.rs Show resolved Hide resolved
Copy link

github-actions bot commented Nov 13, 2024

Coverage Summary

Totals

Count Covered %
Lines 9650 9186 95.19
Regions 2467 2045 82.89
Functions 649 534 82.28
Instantiations 3761 1145 30.44

Files

Expand
File Lines Regions Functions Instantiations
/launchpad-common/src/blacklist.rs 100.00% 88.24% 100.00% 26.25%
/launchpad-common/src/common_events.rs 76.67% 39.39% 56.25% 37.89%
/launchpad-common/src/config.rs 77.78% 50.00% 75.00% 35.71%
/launchpad-common/src/launch_stage.rs 96.08% 77.42% 90.00% 42.86%
/launchpad-common/src/lib.rs 80.00% 42.86% 50.00% 15.91%
/launchpad-common/src/ongoing_operation.rs 63.93% 50.00% 66.67% 43.87%
/launchpad-common/src/permissions.rs 80.00% 50.00% 66.67% 13.64%
/launchpad-common/src/random.rs 55.81% 37.93% 30.00% 27.63%
/launchpad-common/src/setup.rs 46.88% 46.67% 40.00% 16.37%
/launchpad-common/src/tickets.rs 90.00% 72.50% 92.31% 45.45%
/launchpad-common/src/token_send.rs 97.37% 70.00% 75.00% 26.79%
/launchpad-common/src/user_interactions.rs 100.00% 91.67% 100.00% 28.43%
/launchpad-common/src/winner_selection.rs 88.89% 86.79% 88.89% 23.90%
/launchpad-guaranteed-tickets-v2/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-guaranteed-tickets-v2/src/events.rs 94.29% 48.72% 68.42% 31.03%
/launchpad-guaranteed-tickets-v2/src/guaranteed_ticket_winners.rs 94.94% 78.21% 73.68% 31.82%
/launchpad-guaranteed-tickets-v2/src/guaranteed_tickets_init.rs 94.37% 67.12% 68.42% 38.10%
/launchpad-guaranteed-tickets-v2/src/lib.rs 91.71% 87.27% 93.33% 15.91%
/launchpad-guaranteed-tickets-v2/src/token_release.rs 92.47% 67.14% 66.67% 28.40%
/launchpad-guaranteed-tickets-v2/tests/guaranteed_tickets_setup/mod.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-guaranteed-tickets-v2/tests/guaranteed_tickets_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-guaranteed-tickets/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-guaranteed-tickets/src/guaranteed_ticket_winners.rs 90.28% 70.42% 61.54% 28.57%
/launchpad-guaranteed-tickets/src/guaranteed_tickets_init.rs 98.94% 82.22% 100.00% 33.33%
/launchpad-guaranteed-tickets/src/lib.rs 88.89% 83.93% 93.33% 9.52%
/launchpad-guaranteed-tickets/src/token_release.rs 94.38% 69.70% 85.71% 10.00%
/launchpad-guaranteed-tickets/tests/guaranteed_tickets_setup/mod.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-guaranteed-tickets/tests/guaranteed_tickets_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-locked-tokens-and-guaranteed-tickets/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-locked-tokens-and-guaranteed-tickets/src/lib.rs 85.88% 72.73% 80.00% 12.12%
/launchpad-locked-tokens-and-guaranteed-tickets/tests/guaranteed_tickets_setup/mod.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-locked-tokens-and-guaranteed-tickets/tests/guaranteed_tickets_setup/simple_lock_mock.rs 73.42% 48.00% 62.50% 55.56%
/launchpad-locked-tokens-and-guaranteed-tickets/tests/locked_tokens_with_guaranteed_tickets_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-locked-tokens/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-locked-tokens/src/lib.rs 79.41% 44.44% 57.14% 7.14%
/launchpad-locked-tokens/src/locked_launchpad_token_send.rs 97.78% 75.00% 100.00% 40.00%
/launchpad-locked-tokens/tests/launchpad_locked_tokens_test.rs 88.89% 61.76% 76.92% 71.43%
/launchpad-migration-guaranteed-tickets/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-migration-guaranteed-tickets/src/guaranteed_ticket_winners.rs 90.28% 70.42% 61.54% 15.69%
/launchpad-migration-guaranteed-tickets/src/guaranteed_tickets_init.rs 98.94% 82.22% 100.00% 23.08%
/launchpad-migration-guaranteed-tickets/src/lib.rs 77.78% 72.00% 83.33% 7.63%
/launchpad-migration-guaranteed-tickets/tests/migration_guaranteed_tickets_setup/mod.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-migration-guaranteed-tickets/tests/migration_guaranteed_tickets_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-nft-and-guaranteed-tickets/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-nft-and-guaranteed-tickets/src/combined_selection.rs 86.42% 61.36% 66.67% 20.00%
/launchpad-nft-and-guaranteed-tickets/src/lib.rs 90.00% 72.73% 85.71% 10.71%
/launchpad-nft-and-guaranteed-tickets/tests/combined_selection_setup/mod.rs 94.15% 88.68% 88.89% 88.89%
/launchpad-nft-and-guaranteed-tickets/tests/combined_selection_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-with-nft/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad-with-nft/src/claim_nft.rs 95.45% 80.00% 50.00% 8.33%
/launchpad-with-nft/src/confirm_nft.rs 100.00% 75.00% 100.00% 23.08%
/launchpad-with-nft/src/lib.rs 88.41% 68.75% 75.00% 5.71%
/launchpad-with-nft/src/mystery_sft.rs 61.02% 59.38% 66.67% 15.85%
/launchpad-with-nft/src/nft_blacklist.rs 92.31% 55.56% 50.00% 4.17%
/launchpad-with-nft/src/nft_config.rs 63.64% 55.56% 75.00% 11.54%
/launchpad-with-nft/src/nft_winners_selection.rs 84.38% 61.54% 60.00% 10.71%
/launchpad-with-nft/tests/launchpad_v2_test.rs 100.00% 100.00% 100.00% 100.00%
/launchpad-with-nft/tests/launchpad_with_nft_setup/mod.rs 100.00% 93.33% 100.00% 100.00%
/launchpad/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/launchpad/src/lib.rs 0.00% 0.00% 0.00% 0.00%

@psorinionut psorinionut changed the base branch from setup-config-optimization-tryout to main November 13, 2024 13:10
@psorinionut psorinionut marked this pull request as ready for review November 13, 2024 13:16
@psorinionut psorinionut merged commit 3f05c09 into main Dec 3, 2024
6 checks passed
@psorinionut psorinionut deleted the launchpad-v2-audit-fixes branch December 3, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants