Skip to content

Conversation

@alyn509
Copy link
Contributor

@alyn509 alyn509 commented Sep 4, 2024

@alyn509 alyn509 marked this pull request as draft September 4, 2024 08:30
fn accumulated_rewards(
&self,
token_id: &EgldOrEsdtTokenIdentifier,
user: &ManagedAddress,
Copy link
Contributor

Choose a reason for hiding this comment

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

To prevent keys being over 32 bytes, use AddressToIdMapper and only use the user's ID here and in user_accumulated_token_rewards mapper.

Additionally, consuder some shorter base storage keys, i.e.
accRew
totalWinTick,
idxLastWin
userAccRew -> btw, don't use the same name for 2 mappers, even if it's theoretically safe for now, someone might modify the code and break everything
nrEntries
burnPerc

Comment on lines 371 to 402
if tokens.is_empty() {
// if wanted tokens were not specified claim all, and clear user_accumulated_token_rewards storage mapper

for token_id in self.user_accumulated_token_rewards(&caller).iter() {
require!(
!self.accumulated_rewards(&token_id, &caller).is_empty(),
"Token requested not available for claim"
);

self.prepare_token_for_claim(
token_id,
&caller,
&mut accumulated_egld_rewards,
&mut accumulated_esdt_rewards,
);
}
self.user_accumulated_token_rewards(&caller).clear();
} else {
// otherwise claim just what was requested and remove those tokens from the user_accumulated_token_rewards storage mapper
for token_id in tokens {
let _ = &self
.user_accumulated_token_rewards(&caller)
.swap_remove(&token_id);

self.prepare_token_for_claim(
token_id,
&caller,
&mut accumulated_egld_rewards,
&mut accumulated_esdt_rewards,
);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is way too big. Also, you can get rid of the duplicated code by first reading all the storage and putting all values in a managed vec.

Suggested change
if tokens.is_empty() {
// if wanted tokens were not specified claim all, and clear user_accumulated_token_rewards storage mapper
for token_id in self.user_accumulated_token_rewards(&caller).iter() {
require!(
!self.accumulated_rewards(&token_id, &caller).is_empty(),
"Token requested not available for claim"
);
self.prepare_token_for_claim(
token_id,
&caller,
&mut accumulated_egld_rewards,
&mut accumulated_esdt_rewards,
);
}
self.user_accumulated_token_rewards(&caller).clear();
} else {
// otherwise claim just what was requested and remove those tokens from the user_accumulated_token_rewards storage mapper
for token_id in tokens {
let _ = &self
.user_accumulated_token_rewards(&caller)
.swap_remove(&token_id);
self.prepare_token_for_claim(
token_id,
&caller,
&mut accumulated_egld_rewards,
&mut accumulated_esdt_rewards,
);
}
};
if tokens.is_empty() {
let mut all_tokens = ManagedVec::new();
for token_id in self.user_accumulated_token_rewards(&caller).iter() {
all_tokens.push(token_id);
}
self.claim_rewards_user(&self, all_tokens, ...);
} else {
self.claim_rewards_user(&self, tokens.into(), ...);
};

Something like this. Much cleaner and easier to understand. And you do whatever cleanup you have to do in the claim_rewards_user function.

If you want to go for max efficiency, try passing only an iterator to the claim_rewards_user function instead of the ManagedVec itself, and in the case the user gave empty vec as argument, give all_tokens.rev() as argument. The swap_remove operation will be more efficient.

Status::Ended => {
self.distribute_prizes(&lottery_name);
self.clear_storage(&lottery_name);
if self.total_winning_tickets(&lottery_name).is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a check for lottery_info(&lottery_name).is_empty(). Sure, for now it will crash anyway when you try a get(), but it's safer this way.


info.prize_pool -= burn_amount;
info.prize_pool -= &burn_amount;
info.unawarded_amount -= burn_amount;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't comment on unmodified lines, but you should move this whole burn logic to its own function.

And once you do that, you can also de-nest the code by:

if burn_percentage == 0 {
     return;
}

// other code here

Comment on lines 297 to 336
let rand_index = self.get_distinct_random(index_last_winner, total_tickets, 1)[0];

// swap indexes of the winner addresses - we are basically bringing the winners in the first indexes of the mapper
let winner_address = self.ticket_holders(lottery_name).get(rand_index).clone();
let last_index_winner_address =
self.ticket_holders(lottery_name).get(index_last_winner);
self.ticket_holders(lottery_name)
.set(rand_index, &last_index_winner_address);
self.ticket_holders(lottery_name)
.set(index_last_winner, &winner_address);

// distribute to the first place last. Laws of probability say that order doesn't matter.
// this is done to mitigate the effects of BigUint division leading to "spare" prize money being left out at times
// 1st place will get the spare money instead.
if index_last_winner < total_winning_tickets {
let prize = self.calculate_percentage_of(
&info.prize_pool,
&BigUint::from(info.prize_distribution.get(index_last_winner)),
);
if prize > 0 {
self.assign_prize_to_winner(
info.token_identifier.clone(),
&prize,
&winner_address,
);

info.unawarded_amount -= prize;
}
} else {
// insert token in accumulated rewards first place
let first_place_winner = ticket_holders_mapper.get(index_last_winner);

self.assign_prize_to_winner(
info.token_identifier.clone(),
&info.unawarded_amount,
&first_place_winner,
);
}
index_last_winner += 1;
iterations += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Really should be its own function.


let mut iterations = 0;
while index_last_winner <= total_winning_tickets && iterations < MAX_OPERATIONS {
let rand_index = self.get_distinct_random(index_last_winner, total_tickets, 1)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

This way of generating random numbers is terribly inefficient if all you want is one number. If this is the only place where you use that function, simply rewrite it to generate one number in range (index_last_winner, total_tickets)

if index_last_winner < total_winning_tickets {
let prize = self.calculate_percentage_of(
&info.prize_pool,
&BigUint::from(info.prize_distribution.get(index_last_winner)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be this way, since you say you'll do the distribution for the first place last.

Suggested change
&BigUint::from(info.prize_distribution.get(index_last_winner)),
&BigUint::from(info.prize_distribution.get(index_last_winner + 1)),

Copy link
Contributor

Choose a reason for hiding this comment

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

Nvm, that's a ManagedVec, starts from 0.

@github-actions
Copy link

github-actions bot commented Dec 16, 2024

Coverage Summary

Totals

Count Covered %
Lines 73976 41881 56.61
Regions 23900 12969 54.26
Functions 9954 5433 54.58
Instantiations 238902 73287 30.68

Files

Expand
File Lines Regions Functions Instantiations
/chain/core/src/std/bech32_address.rs 39.37% 39.53% 33.33% 12.06%
/chain/core/src/token_identifier_util.rs 100.00% 100.00% 100.00% 50.00%
/chain/core/src/types/address.rs 71.81% 62.79% 61.11% 32.09%
/chain/core/src/types/bls_key.rs 0.00% 0.00% 0.00% 0.00%
/chain/core/src/types/bls_signature.rs 0.00% 0.00% 0.00% 0.00%
/chain/core/src/types/boxed_bytes.rs 96.63% 94.20% 93.94% 14.80%
/chain/core/src/types/flags/code_metadata.rs 100.00% 97.53% 100.00% 28.89%
/chain/core/src/types/flags/esdt_local_role.rs 59.00% 57.14% 50.00% 5.76%
/chain/core/src/types/flags/esdt_local_role_flags.rs 100.00% 100.00% 100.00% 57.14%
/chain/core/src/types/flags/esdt_token_type.rs 52.38% 41.86% 57.14% 16.00%
/chain/core/src/types/flags/return_code.rs 51.67% 37.10% 83.33% 41.67%
/chain/core/src/types/flags/token_type.rs 62.50% 37.50% 100.00% 50.00%
/chain/core/src/types/h256.rs 78.95% 70.59% 70.37% 33.53%
/chain/core/src/types/heap_address.rs 50.81% 45.24% 37.50% 25.40%
/chain/core/src/types/heap_h256.rs 73.57% 69.05% 62.07% 40.35%
/chain/core/src/types/time/duration_millis.rs 65.31% 60.00% 72.73% 37.50%
/chain/core/src/types/time/duration_seconds.rs 30.61% 33.33% 45.45% 27.27%
/chain/core/src/types/time/time_test.rs 100.00% 100.00% 100.00% 100.00%
/chain/core/src/types/time/timestamp_millis.rs 94.55% 82.35% 92.31% 61.54%
/chain/core/src/types/time/timestamp_seconds.rs 83.64% 70.59% 76.92% 49.25%
/chain/vm/src/blockchain/blockchain_mock.rs 0.00% 0.00% 0.00% 0.00%
/chain/vm/src/blockchain/state/account_data.rs 30.43% 16.67% 50.00% 25.00%
/chain/vm/src/blockchain/state/block_info.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/blockchain/state/blockchain_state.rs 86.00% 79.31% 72.22% 36.11%
/chain/vm/src/blockchain/state/blockchain_state_account_util.rs 87.04% 72.22% 87.50% 43.75%
/chain/vm/src/blockchain/state/esdt_data.rs 77.05% 70.83% 78.57% 39.29%
/chain/vm/src/blockchain/state/esdt_instance.rs 58.82% 66.67% 66.67% 33.33%
/chain/vm/src/blockchain/state/esdt_instances.rs 64.29% 66.67% 88.24% 44.12%
/chain/vm/src/blockchain/state/esdt_roles.rs 56.25% 30.00% 75.00% 37.50%
/chain/vm/src/blockchain/vm_config.rs 72.22% 80.00% 80.00% 40.00%
/chain/vm/src/builtin_functions/builtin_func_container.rs 99.05% 98.18% 100.00% 8.92%
/chain/vm/src/builtin_functions/builtin_func_trait.rs 75.00% 66.67% 66.67% 33.33%
/chain/vm/src/builtin_functions/esdt_nft/esdt_local_burn.rs 85.71% 55.56% 50.00% 0.52%
/chain/vm/src/builtin_functions/esdt_nft/esdt_local_mint.rs 88.64% 60.00% 50.00% 0.52%
/chain/vm/src/builtin_functions/esdt_nft/esdt_nft_add_quantity_mock.rs 89.80% 60.00% 50.00% 0.52%
/chain/vm/src/builtin_functions/esdt_nft/esdt_nft_add_uri_mock.rs 90.20% 71.43% 66.67% 0.52%
/chain/vm/src/builtin_functions/esdt_nft/esdt_nft_burn_mock.rs 87.23% 55.56% 50.00% 0.52%
/chain/vm/src/builtin_functions/esdt_nft/esdt_nft_create_mock.rs 90.54% 63.64% 50.00% 0.35%
/chain/vm/src/builtin_functions/esdt_nft/esdt_nft_update_attributes_mock.rs 90.00% 71.43% 66.67% 0.52%
/chain/vm/src/builtin_functions/general/change_owner_mock.rs 75.86% 71.43% 66.67% 0.52%
/chain/vm/src/builtin_functions/general/claim_developer_rewards_mock.rs 82.93% 83.33% 66.67% 0.52%
/chain/vm/src/builtin_functions/general/delete_username_mock.rs 75.00% 71.43% 66.67% 0.52%
/chain/vm/src/builtin_functions/general/migrate_username_mock.rs 0.00% 0.00% 0.00% 0.00%
/chain/vm/src/builtin_functions/general/set_username_mock.rs 67.57% 66.67% 66.67% 0.52%
/chain/vm/src/builtin_functions/general/upgrade_contract.rs 88.52% 84.21% 75.00% 0.78%
/chain/vm/src/builtin_functions/transfer/esdt_multi_transfer_mock.rs 89.36% 77.78% 80.00% 2.02%
/chain/vm/src/builtin_functions/transfer/esdt_nft_transfer_mock.rs 86.67% 73.91% 80.00% 2.02%
/chain/vm/src/builtin_functions/transfer/esdt_transfer_mock.rs 88.57% 80.95% 80.00% 2.02%
/chain/vm/src/builtin_functions/transfer/transfer_common.rs 100.00% 100.00% 100.00% 3.47%
/chain/vm/src/crypto_functions.rs 96.15% 94.44% 100.00% 50.00%
/chain/vm/src/crypto_functions_bls.rs 98.24% 93.91% 100.00% 100.00%
/chain/vm/src/display_util.rs 83.33% 85.71% 66.67% 33.33%
/chain/vm/src/executor_impl/we_executor.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/blockchain_rng.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/blockchain_update.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/failing_executor.rs 0.00% 0.00% 0.00% 0.00%
/chain/vm/src/host/context/managed_type_container.rs 100.00% 100.00% 100.00% 75.00%
/chain/vm/src/host/context/managed_type_container/handle_map.rs 84.38% 70.00% 62.50% 71.05%
/chain/vm/src/host/context/managed_type_container/tx_big_float.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/managed_type_container/tx_big_int.rs 94.44% 89.74% 100.00% 61.54%
/chain/vm/src/host/context/managed_type_container/tx_managed_buffer.rs 98.27% 94.00% 100.00% 73.03%
/chain/vm/src/host/context/managed_type_container/tx_managed_map.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_async_call_data.rs 97.98% 93.33% 100.00% 50.00%
/chain/vm/src/host/context/tx_async_promise.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_back_transfers.rs 87.50% 80.00% 50.00% 25.00%
/chain/vm/src/host/context/tx_cache.rs 92.38% 91.43% 84.21% 5.29%
/chain/vm/src/host/context/tx_cache_balance_util.rs 89.57% 86.54% 84.62% 42.31%
/chain/vm/src/host/context/tx_cache_source.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_context.rs 80.27% 72.73% 75.00% 56.77%
/chain/vm/src/host/context/tx_context_ref.rs 60.00% 66.67% 66.67% 33.33%
/chain/vm/src/host/context/tx_input.rs 75.51% 85.00% 71.43% 35.71%
/chain/vm/src/host/context/tx_input_call_type.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_input_function.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_panic.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_result.rs 72.55% 73.85% 65.22% 34.69%
/chain/vm/src/host/context/tx_result_calls.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/context/tx_result_gas_used.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/host/execution/exec_call.rs 94.01% 80.49% 100.00% 97.94%
/chain/vm/src/host/execution/exec_create.rs 93.15% 80.00% 100.00% 86.96%
/chain/vm/src/host/execution/exec_general_tx.rs 100.00% 100.00% 100.00% 98.44%
/chain/vm/src/host/execution/exec_query.rs 100.00% 100.00% 100.00% 91.30%
/chain/vm/src/host/runtime.rs 87.00% 82.35% 78.57% 91.90%
/chain/vm/src/host/runtime/runtime_instance_call_default.rs 80.77% 74.07% 100.00% 50.00%
/chain/vm/src/host/vm_hooks/instance_state_set_early_exit.rs 0.00% 0.00% 0.00% 0.00%
/chain/vm/src/host/vm_hooks/vh_context.rs 100.00% 100.00% 100.00% 53.88%
/chain/vm/src/host/vm_hooks/vh_dispatcher.rs 53.24% 57.57% 50.18% 7.88%
/chain/vm/src/host/vm_hooks/vh_early_exit.rs 66.67% 66.67% 66.67% 33.33%
/chain/vm/src/host/vm_hooks/vh_handler.rs 100.00% 87.50% 100.00% 66.57%
/chain/vm/src/host/vm_hooks/vh_handler/vh_blockchain.rs 95.38% 74.02% 97.37% 5.62%
/chain/vm/src/host/vm_hooks/vh_handler/vh_call_value.rs 100.00% 86.96% 100.00% 40.73%
/chain/vm/src/host/vm_hooks/vh_handler/vh_crypto.rs 100.00% 89.29% 100.00% 1.21%
/chain/vm/src/host/vm_hooks/vh_handler/vh_endpoint_arg.rs 78.79% 75.00% 75.00% 25.00%
/chain/vm/src/host/vm_hooks/vh_handler/vh_endpoint_finish.rs 100.00% 88.00% 100.00% 22.12%
/chain/vm/src/host/vm_hooks/vh_handler/vh_error.rs 93.33% 80.00% 100.00% 22.73%
/chain/vm/src/host/vm_hooks/vh_handler/vh_log.rs 100.00% 66.67% 100.00% 22.73%
/chain/vm/src/host/vm_hooks/vh_handler/vh_managed_types.rs 98.54% 76.19% 100.00% 25.91%
/chain/vm/src/host/vm_hooks/vh_handler/vh_managed_types/vh_big_float.rs 85.65% 68.37% 81.25% 1.16%
/chain/vm/src/host/vm_hooks/vh_handler/vh_managed_types/vh_big_int.rs 72.69% 64.44% 83.33% 12.61%
/chain/vm/src/host/vm_hooks/vh_handler/vh_managed_types/vh_managed_buffer.rs 94.22% 71.88% 92.31% 47.48%
/chain/vm/src/host/vm_hooks/vh_handler/vh_managed_types/vh_managed_map.rs 100.00% 100.00% 100.00% 2.73%
/chain/vm/src/host/vm_hooks/vh_handler/vh_send.rs 94.63% 77.94% 90.91% 10.68%
/chain/vm/src/host/vm_hooks/vh_handler/vh_storage.rs 100.00% 75.00% 100.00% 50.00%
/chain/vm/src/host/vm_hooks/vh_tx_context.rs 96.68% 93.59% 93.94% 44.67%
/chain/vm/src/schedule/gas_schedule.rs 57.14% 71.43% 50.00% 25.00%
/chain/vm/src/schedule/gas_schedule_version.rs 38.89% 30.77% 66.67% 33.33%
/chain/vm/src/schedule/gas_schedules.rs 33.33% 27.27% 100.00% 50.00%
/chain/vm/src/system_sc.rs 75.00% 41.79% 100.00% 50.00%
/chain/vm/src/system_sc/system_sc_issue.rs 60.87% 69.23% 78.57% 61.54%
/chain/vm/src/system_sc/system_sc_special_roles.rs 80.00% 83.33% 100.00% 50.00%
/chain/vm/src/system_sc/system_sc_unimplemented.rs 0.00% 0.00% 0.00% 0.00%
/chain/vm/src/types.rs 100.00% 100.00% 100.00% 50.00%
/chain/vm/src/with_shared/shareable.rs 81.71% 79.59% 86.67% 64.52%
/chain/vm/src/with_shared/with_shared_mut_ref.rs 89.09% 93.33% 100.00% 90.00%
/contracts/core/price-aggregator/src/events.rs 83.87% 37.50% 37.50% 26.79%
/contracts/core/price-aggregator/src/lib.rs 74.18% 57.55% 62.96% 32.37%
/contracts/core/price-aggregator/src/median.rs 81.25% 53.33% 100.00% 75.00%
/contracts/core/price-aggregator/src/price_aggregator_data.rs 0.00% 0.00% 0.00% 0.00%
/contracts/core/wegld-swap/src/wegld.rs 92.50% 80.00% 66.67% 19.15%
/contracts/examples/adder/interactor/src/basic_interactor.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/adder/interactor/src/basic_interactor_cli.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/adder/interactor/src/basic_interactor_config.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/adder/interactor/src/basic_interactor_main.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/adder/interactor/src/basic_interactor_state.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/adder/src/adder.rs 100.00% 100.00% 100.00% 32.56%
/contracts/examples/adder/src/adder_proxy.rs 100.00% 100.00% 100.00% 29.17%
/contracts/examples/bonding-curve-contract/src/bonding_curve_contract.rs 83.33% 77.78% 77.78% 23.81%
/contracts/examples/bonding-curve-contract/src/function_selector.rs 68.42% 40.00% 16.67% 10.00%
/contracts/examples/check-pause/src/check_pause.rs 75.00% 66.67% 66.67% 18.52%
/contracts/examples/crowdfunding-esdt/src/crowdfunding_esdt.rs 96.97% 88.89% 81.82% 37.14%
/contracts/examples/crowdfunding-esdt/src/crowdfunding_esdt_proxy.rs 62.22% 50.00% 50.00% 40.00%
/contracts/examples/crypto-bubbles/src/crypto_bubbles.rs 100.00% 100.00% 100.00% 33.75%
/contracts/examples/crypto-kitties/common/kitty/src/color.rs 70.37% 25.00% 25.00% 7.69%
/contracts/examples/crypto-kitties/common/kitty/src/kitty.rs 87.93% 58.82% 58.33% 20.59%
/contracts/examples/crypto-kitties/common/kitty/src/kitty_genes.rs 43.75% 14.29% 14.29% 3.85%
/contracts/examples/crypto-kitties/common/random/src/lib.rs 64.71% 53.33% 50.00% 36.36%
/contracts/examples/crypto-kitties/kitty-auction/src/auction.rs 65.38% 10.00% 10.00% 5.88%
/contracts/examples/crypto-kitties/kitty-auction/src/kitty_ownership_proxy.rs 20.63% 21.74% 21.74% 17.86%
/contracts/examples/crypto-kitties/kitty-auction/src/lib.rs 85.88% 78.87% 80.95% 30.17%
/contracts/examples/crypto-kitties/kitty-genetic-alg/src/lib.rs 100.00% 100.00% 100.00% 36.84%
/contracts/examples/crypto-kitties/kitty-ownership/src/kitty_genetic_alg_proxy.rs 69.23% 66.67% 66.67% 28.57%
/contracts/examples/crypto-kitties/kitty-ownership/src/lib.rs 84.03% 75.36% 89.74% 29.93%
/contracts/examples/crypto-zombies/src/kitty_obj.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/kitty_ownership_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/proxy_crypto_zombies.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/storage.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/zombie.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/zombie_attack.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/zombie_factory.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/zombie_feeding.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/crypto-zombies/src/zombie_helper.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/digital-cash/src/deposit_info.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/digital-cash/src/digital_cash.rs 61.36% 55.56% 85.71% 25.53%
/contracts/examples/digital-cash/src/digital_cash_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/digital-cash/src/helpers.rs 88.89% 85.71% 80.00% 36.36%
/contracts/examples/digital-cash/src/pay_fee_and_fund.rs 98.21% 92.86% 80.00% 25.00%
/contracts/examples/digital-cash/src/signature_operations.rs 98.99% 85.19% 88.89% 31.25%
/contracts/examples/digital-cash/src/storage.rs 50.00% 50.00% 50.00% 20.83%
/contracts/examples/empty/src/empty.rs 100.00% 100.00% 100.00% 17.86%
/contracts/examples/esdt-transfer-with-fee/src/esdt_transfer_with_fee.rs 97.30% 96.67% 100.00% 27.27%
/contracts/examples/esdt-transfer-with-fee/src/fee.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/factorial/src/factorial.rs 93.33% 87.50% 66.67% 19.44%
/contracts/examples/fractional-nfts/src/fractional_nfts.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/fractional-nfts/src/fractional_uri_info.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/fractional-nfts/src/nft_marketplace_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/lottery-esdt/src/basics/storage.rs 50.00% 50.00% 50.00% 30.77%
/contracts/examples/lottery-esdt/src/basics/utils.rs 84.62% 77.78% 60.00% 18.75%
/contracts/examples/lottery-esdt/src/basics/views.rs 92.86% 87.50% 66.67% 14.29%
/contracts/examples/lottery-esdt/src/lottery.rs 100.00% 100.00% 100.00% 23.81%
/contracts/examples/lottery-esdt/src/lottery_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/lottery-esdt/src/specific/award.rs 88.28% 80.43% 90.91% 35.71%
/contracts/examples/lottery-esdt/src/specific/awarding_status.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/lottery-esdt/src/specific/buy.rs 97.14% 91.67% 75.00% 21.43%
/contracts/examples/lottery-esdt/src/specific/claim.rs 70.45% 55.00% 66.67% 22.22%
/contracts/examples/lottery-esdt/src/specific/lottery_info.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/lottery-esdt/src/specific/setup.rs 98.77% 96.43% 75.00% 21.43%
/contracts/examples/lottery-esdt/src/specific/status.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact_cli.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact_config.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact_nfts.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact_state.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/multisig_interact_wegld.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/interact/src/wegld_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/multisig/src/action.rs 58.82% 58.82% 41.67% 10.17%
/contracts/examples/multisig/src/multisig.rs 94.12% 90.48% 92.31% 23.89%
/contracts/examples/multisig/src/multisig_events.rs 50.00% 50.00% 50.00% 29.33%
/contracts/examples/multisig/src/multisig_perform.rs 96.70% 91.23% 91.67% 33.33%
/contracts/examples/multisig/src/multisig_propose.rs 98.11% 94.44% 91.67% 28.66%
/contracts/examples/multisig/src/multisig_proxy.rs 66.89% 42.86% 42.86% 19.54%
/contracts/examples/multisig/src/multisig_state.rs 98.04% 95.24% 90.91% 27.44%
/contracts/examples/multisig/src/multisig_view_proxy.rs 31.31% 19.05% 19.05% 8.70%
/contracts/examples/multisig/src/user_role.rs 92.86% 83.33% 83.33% 31.25%
/contracts/examples/nft-minter/src/lib.rs 70.27% 73.68% 42.86% 18.42%
/contracts/examples/nft-minter/src/nft_marketplace_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/nft-minter/src/nft_module.rs 55.17% 37.93% 33.33% 11.76%
/contracts/examples/nft-storage-prepay/src/nft_storage_prepay.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/nft-subscription/src/lib.rs 87.67% 85.71% 85.71% 26.42%
/contracts/examples/order-book/factory/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/order-book/pair/src/common.rs 44.83% 28.57% 25.00% 10.78%
/contracts/examples/order-book/pair/src/events.rs 97.22% 93.33% 83.33% 19.51%
/contracts/examples/order-book/pair/src/global.rs 33.33% 33.33% 33.33% 4.35%
/contracts/examples/order-book/pair/src/lib.rs 100.00% 100.00% 100.00% 18.00%
/contracts/examples/order-book/pair/src/orders.rs 98.93% 89.80% 95.00% 24.21%
/contracts/examples/order-book/pair/src/validation.rs 88.00% 79.55% 86.67% 26.00%
/contracts/examples/ping-pong-egld/dapp/src/components/button.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/components/footer.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/components/network_status.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/context.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/interactor.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/main.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/pages/home.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/requests/proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/requests/query.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/requests/transaction.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/dapp/src/routes.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/interactor/src/interact.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/interactor/src/interact_cli.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/interactor/src/interact_config.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/interactor/src/interact_main.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/interactor/src/interact_state.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/src/ping_pong.rs 79.09% 80.95% 72.73% 13.66%
/contracts/examples/ping-pong-egld/src/proxy_ping_pong_egld.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/ping-pong-egld/src/types.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/proxy-pause/src/pause_sc_proxy.rs 100.00% 100.00% 100.00% 50.00%
/contracts/examples/proxy-pause/src/proxy_pause.rs 75.00% 83.33% 76.92% 25.30%
/contracts/examples/rewards-distribution/src/rewards_distribution.rs 91.39% 85.57% 78.95% 18.91%
/contracts/examples/rewards-distribution/src/rewards_distribution_proxy.rs 52.54% 42.11% 42.11% 19.61%
/contracts/examples/rewards-distribution/src/seed_nft_minter_proxy.rs 14.29% 20.00% 20.00% 8.11%
/contracts/examples/seed-nft-minter/src/distribution_module.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/seed-nft-minter/src/nft_marketplace_proxy.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/seed-nft-minter/src/nft_module.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/seed-nft-minter/src/seed_nft_minter.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/token-release/src/contract_data.rs 0.00% 0.00% 0.00% 0.00%
/contracts/examples/token-release/src/token_release.rs 65.95% 56.41% 73.08% 26.06%
/contracts/modules/src/bonding_curve/curves/linear_function.rs 68.75% 28.57% 28.57% 10.53%
/contracts/modules/src/bonding_curve/mod.rs 0.00% 0.00% 0.00% 0.00%
/contracts/modules/src/bonding_curve/utils/events.rs 50.00% 50.00% 50.00% 8.70%
/contracts/modules/src/bonding_curve/utils/owner_endpoints.rs 88.65% 84.09% 60.00% 12.24%
/contracts/modules/src/bonding_curve/utils/storage.rs 50.00% 50.00% 50.00% 13.79%
/contracts/modules/src/bonding_curve/utils/structs.rs 29.73% 17.86% 14.29% 5.66%
/contracts/modules/src/bonding_curve/utils/user_endpoints.rs 95.77% 92.00% 80.95% 22.67%
/contracts/modules/src/claim_developer_rewards.rs 83.33% 66.67% 66.67% 6.38%
/contracts/modules/src/default_issue_callbacks.rs 3.57% 9.09% 20.00% 1.14%
/contracts/modules/src/dns.rs 90.00% 66.67% 66.67% 4.48%
/contracts/modules/src/dns_proxy.rs 100.00% 100.00% 100.00% 9.09%
/contracts/modules/src/esdt.rs 1.54% 5.88% 11.11% 1.28%
/contracts/modules/src/features.rs 85.71% 76.47% 66.67% 8.57%
/contracts/modules/src/governance/governance_configurable.rs 75.36% 75.00% 64.29% 5.98%
/contracts/modules/src/governance/governance_events.rs 50.00% 50.00% 50.00% 8.41%
/contracts/modules/src/governance/governance_proposal.rs 27.94% 27.03% 27.03% 6.25%
/contracts/modules/src/governance/mod.rs 67.73% 64.15% 70.37% 6.21%
/contracts/modules/src/ongoing_operation.rs 57.78% 45.83% 57.14% 6.41%
/contracts/modules/src/only_admin.rs 76.92% 66.67% 66.67% 5.56%
/contracts/modules/src/pause.rs 83.33% 77.78% 77.78% 24.31%
/contracts/modules/src/staking.rs 96.83% 90.00% 81.25% 20.72%
/contracts/modules/src/subscription.rs 85.94% 64.29% 54.55% 13.33%
/contracts/modules/src/token_merge/custom_merged_token_attributes.rs 81.25% 66.67% 66.67% 11.11%
/contracts/modules/src/token_merge/merged_token_instances.rs 90.41% 85.29% 100.00% 14.29%
/contracts/modules/src/token_merge/merged_token_setup.rs 72.62% 66.67% 60.00% 5.39%
/contracts/modules/src/token_merge/mod.rs 95.61% 87.80% 80.00% 11.11%
/contracts/modules/src/transfer_role_proxy.rs 83.64% 77.78% 71.43% 31.37%
/contracts/modules/src/users.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/nested_de_derive.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/nested_en_derive.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/top_de_derive.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/top_en_derive.rs 0.00% 0.00% 0.00% 0.00%
/data/codec-derive/src/util.rs 0.00% 0.00% 0.00% 0.00%
/data/codec/src/codec_convert.rs 100.00% 100.00% 100.00% 92.86%
/data/codec/src/codec_err.rs 83.33% 83.33% 83.33% 3.75%
/data/codec/src/codec_err_handler.rs 50.00% 50.00% 50.00% 4.40%
/data/codec/src/impl_for_types/impl_array.rs 58.11% 62.07% 50.00% 20.38%
/data/codec/src/impl_for_types/impl_array_vec.rs 97.18% 84.85% 100.00% 32.91%
/data/codec/src/impl_for_types/impl_bool.rs 95.00% 73.33% 100.00% 35.76%
/data/codec/src/impl_for_types/impl_bytes.rs 100.00% 100.00% 100.00% 100.00%
/data/codec/src/impl_for_types/impl_empty.rs 97.67% 90.91% 100.00% 48.68%
/data/codec/src/impl_for_types/impl_non_zero_usize.rs 94.74% 77.78% 100.00% 22.73%
/data/codec/src/impl_for_types/impl_num_signed.rs 100.00% 89.47% 100.00% 29.55%
/data/codec/src/impl_for_types/impl_num_unsigned.rs 100.00% 95.65% 100.00% 49.32%
/data/codec/src/impl_for_types/impl_option.rs 72.29% 62.50% 66.67% 37.89%
/data/codec/src/impl_for_types/impl_phantom.rs 91.80% 66.67% 66.67% 57.14%
/data/codec/src/impl_for_types/impl_ref.rs 83.33% 62.50% 83.33% 52.11%
/data/codec/src/impl_for_types/impl_rust_big_int.rs 100.00% 87.50% 100.00% 50.00%
/data/codec/src/impl_for_types/impl_rust_big_uint.rs 100.00% 87.50% 100.00% 55.88%
/data/codec/src/impl_for_types/impl_slice.rs 93.33% 85.71% 91.67% 35.08%
/data/codec/src/impl_for_types/impl_string.rs 98.89% 84.38% 100.00% 33.33%
/data/codec/src/impl_for_types/impl_tuple.rs 91.30% 82.35% 100.00% 13.00%
/data/codec/src/impl_for_types/impl_unit.rs 100.00% 100.00% 100.00% 66.67%
/data/codec/src/impl_for_types/impl_vec.rs 98.70% 84.85% 100.00% 68.00%
/data/codec/src/impl_for_types/local_macro.rs 100.00% 100.00% 100.00% 45.78%
/data/codec/src/multi/multi_value_length.rs 0.00% 0.00% 0.00% 0.00%
/data/codec/src/multi/top_de_multi.rs 59.09% 33.33% 66.67% 29.11%
/data/codec/src/multi/top_de_multi_input.rs 72.97% 52.63% 80.00% 30.51%
/data/codec/src/multi/top_en_multi.rs 75.68% 61.54% 75.00% 25.73%
/data/codec/src/multi/top_en_multi_output.rs 58.82% 60.00% 50.00% 86.36%
/data/codec/src/multi_types/multi_value_ignore.rs 53.33% 60.00% 50.00% 16.67%
/data/codec/src/multi_types/multi_value_optional.rs 73.81% 63.33% 57.14% 18.22%
/data/codec/src/multi_types/multi_value_placeholder.rs 0.00% 0.00% 0.00% 0.00%
/data/codec/src/multi_types/multi_value_tuple.rs 80.00% 76.92% 83.33% 13.40%
/data/codec/src/multi_types/multi_value_unit.rs 100.00% 100.00% 100.00% 22.58%
/data/codec/src/multi_types/multi_value_vec.rs 64.15% 70.83% 53.85% 32.22%
/data/codec/src/num_conv.rs 98.84% 94.74% 100.00% 100.00%
/data/codec/src/single/nested_de.rs 36.84% 16.67% 33.33% 71.43%
/data/codec/src/single/nested_de_input.rs 63.64% 71.43% 75.00% 57.86%
/data/codec/src/single/nested_de_input_owned.rs 96.77% 81.82% 100.00% 46.88%
/data/codec/src/single/nested_de_input_slice.rs 97.06% 88.24% 100.00% 98.06%
/data/codec/src/single/nested_en.rs 62.50% 50.00% 75.00% 75.30%
/data/codec/src/single/nested_en_output.rs 40.91% 75.00% 75.00% 57.52%
/data/codec/src/single/top_de.rs 61.90% 58.82% 60.00% 41.24%
/data/codec/src/single/top_de_input.rs 54.74% 60.00% 61.90% 43.07%
/data/codec/src/single/top_en.rs 75.68% 57.14% 80.00% 87.61%
/data/codec/src/single/top_en_output.rs 68.75% 75.00% 75.00% 52.86%
/data/codec/src/test_util.rs 86.15% 88.89% 80.00% 97.12%
/data/codec/src/transmute.rs 100.00% 100.00% 100.00% 83.33%
/data/codec/src/try_static_cast.rs 82.05% 74.19% 90.00% 29.92%
/data/human-readable/src/decode.rs 86.29% 75.84% 36.84% 18.42%
/data/human-readable/src/defaults.rs 88.04% 83.56% 75.00% 37.50%
/data/human-readable/src/encode.rs 84.15% 78.62% 61.54% 30.77%
/data/human-readable/src/format.rs 95.24% 85.71% 85.71% 42.86%
/data/human-readable/src/schema.rs 76.31% 74.53% 85.71% 52.94%
/data/human-readable/src/value/any_value.rs 81.82% 66.67% 100.00% 58.33%
/data/human-readable/src/value/enum_value.rs 100.00% 70.00% 100.00% 25.00%
/data/human-readable/src/value/single_value.rs 87.50% 78.57% 100.00% 33.33%
/data/human-readable/src/value/struct_value.rs 100.00% 81.82% 100.00% 41.67%
/framework/base/src/abi.rs 100.00% 100.00% 100.00% 50.00%
/framework/base/src/abi/build_info_abi.rs 100.00% 100.00% 100.00% 50.00%
/framework/base/src/abi/contract_abi.rs 100.00% 100.00% 100.00% 47.37%
/framework/base/src/abi/endpoint_abi.rs 94.52% 92.31% 91.67% 43.22%
/framework/base/src/abi/esdt_attribute_abi.rs 100.00% 100.00% 100.00% 86.67%
/framework/base/src/abi/event_abi.rs 93.33% 75.00% 66.67% 55.81%
/framework/base/src/abi/type_abi.rs 100.00% 100.00% 100.00% 47.95%
/framework/base/src/abi/type_abi_impl_basic.rs 87.74% 86.00% 89.74% 32.34%
/framework/base/src/abi/type_abi_impl_big_int.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/abi/type_abi_impl_codec_multi.rs 80.82% 75.00% 75.00% 27.56%
/framework/base/src/abi/type_abi_impl_vm_core.rs 93.41% 80.00% 83.33% 40.38%
/framework/base/src/abi/type_description.rs 98.25% 96.30% 91.67% 45.83%
/framework/base/src/abi/type_description_container.rs 100.00% 100.00% 100.00% 44.83%
/framework/base/src/api.rs 100.00% 100.00% 100.00% 4.00%
/framework/base/src/api/blockchain_api.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/endpoint_arg_api.rs 61.54% 25.00% 66.67% 17.76%
/framework/base/src/api/error_api.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/external_view/ev_storage_api.rs 81.82% 80.00% 80.00% 24.24%
/framework/base/src/api/external_view/ev_wrapper.rs 55.32% 53.33% 53.33% 17.02%
/framework/base/src/api/managed_types/big_float_api.rs 100.00% 100.00% 100.00% 33.33%
/framework/base/src/api/managed_types/big_int_api.rs 100.00% 100.00% 100.00% 38.57%
/framework/base/src/api/managed_types/const_handles.rs 100.00% 100.00% 100.00% 66.67%
/framework/base/src/api/managed_types/handles.rs 73.08% 75.00% 71.43% 78.23%
/framework/base/src/api/managed_types/managed_type_api_impl.rs 100.00% 100.00% 100.00% 33.33%
/framework/base/src/api/managed_types/static_var_api.rs 100.00% 100.00% 100.00% 64.91%
/framework/base/src/api/managed_types/static_var_api_flags.rs 100.00% 100.00% 100.00% 100.00%
/framework/base/src/api/print_api.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/storage_api.rs 100.00% 100.00% 100.00% 87.76%
/framework/base/src/api/uncallable/big_float_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/big_int_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/blockchain_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/call_value_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/crypto_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/elliptic_curve_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/endpoint_arg_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/endpoint_finish_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/error_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/log_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/managed_buffer_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/managed_map_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/managed_type_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/print_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/send_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/static_var_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/storage_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/uncallable/vm_api_uncallable.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/api/vm_api.rs 100.00% 100.00% 100.00% 72.77%
/framework/base/src/contract_base/contract_base_trait.rs 77.78% 77.78% 77.78% 52.84%
/framework/base/src/contract_base/universal_contract_obj.rs 62.50% 50.00% 50.00% 92.17%
/framework/base/src/contract_base/wrappers/blockchain_wrapper.rs 78.51% 76.19% 71.01% 26.41%
/framework/base/src/contract_base/wrappers/call_value_wrapper.rs 97.55% 92.45% 100.00% 40.73%
/framework/base/src/contract_base/wrappers/crypto_wrapper.rs 53.68% 58.33% 58.33% 7.43%
/framework/base/src/contract_base/wrappers/error_helper.rs 60.00% 66.67% 66.67% 34.85%
/framework/base/src/contract_base/wrappers/send_raw_wrapper.rs 81.22% 81.40% 86.36% 38.57%
/framework/base/src/contract_base/wrappers/send_wrapper.rs 27.63% 16.13% 30.23% 15.38%
/framework/base/src/contract_base/wrappers/serializer.rs 93.33% 88.89% 88.89% 40.77%
/framework/base/src/contract_base/wrappers/storage_raw_wrapper.rs 100.00% 100.00% 100.00% 13.73%
/framework/base/src/external_view_contract.rs 100.00% 100.00% 100.00% 2.83%
/framework/base/src/formatter/formatter_impl_bool.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/formatter/formatter_impl_bytes.rs 100.00% 100.00% 100.00% 22.22%
/framework/base/src/formatter/formatter_impl_num.rs 100.00% 100.00% 100.00% 55.93%
/framework/base/src/formatter/formatter_impl_vm_core.rs 100.00% 100.00% 100.00% 33.33%
/framework/base/src/formatter/formatter_traits.rs 52.17% 22.22% 22.22% 20.00%
/framework/base/src/formatter/hex_util.rs 92.16% 89.29% 100.00% 83.33%
/framework/base/src/hex_call_data/cd_de.rs 97.47% 95.60% 100.00% 84.00%
/framework/base/src/hex_call_data/cd_ser.rs 78.89% 70.97% 73.33% 47.83%
/framework/base/src/io/arg_de_input.rs 74.74% 78.79% 87.50% 36.27%
/framework/base/src/io/arg_error_handler.rs 100.00% 100.00% 100.00% 41.51%
/framework/base/src/io/arg_id.rs 75.00% 75.00% 75.00% 68.31%
/framework/base/src/io/arg_loader_multi.rs 100.00% 91.67% 100.00% 42.86%
/framework/base/src/io/arg_loader_single.rs 59.09% 50.00% 50.00% 68.87%
/framework/base/src/io/arg_nested_tuple.rs 94.87% 82.14% 100.00% 25.43%
/framework/base/src/io/bytes_arg_loader.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/io/call_value_init.rs 88.24% 91.67% 87.50% 59.29%
/framework/base/src/io/finish.rs 83.56% 72.73% 91.67% 19.78%
/framework/base/src/io/signal_error.rs 100.00% 100.00% 100.00% 4.72%
/framework/base/src/log_util.rs 100.00% 100.00% 100.00% 38.90%
/framework/base/src/non_zero_util.rs 77.55% 83.33% 66.67% 42.86%
/framework/base/src/std_impl/bech32_address_impl.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/storage/mappers/address_to_id_mapper.rs 96.49% 83.78% 100.00% 11.64%
/framework/base/src/storage/mappers/bi_di_mapper.rs 65.66% 69.81% 63.33% 24.05%
/framework/base/src/storage/mappers/linked_list_mapper.rs 81.80% 69.93% 67.27% 23.55%
/framework/base/src/storage/mappers/map_mapper.rs 84.55% 84.15% 75.61% 31.01%
/framework/base/src/storage/mappers/map_storage_mapper.rs 80.38% 79.41% 76.67% 26.02%
/framework/base/src/storage/mappers/ordered_binary_tree_mapper.rs 73.78% 68.89% 83.33% 28.57%
/framework/base/src/storage/mappers/queue_mapper.rs 90.51% 79.17% 79.07% 39.08%
/framework/base/src/storage/mappers/set_mapper.rs 83.11% 76.47% 77.78% 38.88%
/framework/base/src/storage/mappers/single_value_mapper.rs 89.69% 87.50% 89.47% 45.96%
/framework/base/src/storage/mappers/source.rs 100.00% 100.00% 100.00% 50.62%
/framework/base/src/storage/mappers/timelock/timelock_mapper.rs 88.75% 82.35% 78.57% 16.75%
/framework/base/src/storage/mappers/token/fungible_token_mapper.rs 12.97% 14.46% 19.35% 3.59%
/framework/base/src/storage/mappers/token/non_fungible_token_mapper.rs 15.07% 23.71% 29.27% 6.32%
/framework/base/src/storage/mappers/token/token_attributes_mapper.rs 92.39% 90.16% 93.10% 8.23%
/framework/base/src/storage/mappers/token/token_mapper_state.rs 70.00% 48.39% 50.00% 13.51%
/framework/base/src/storage/mappers/unique_id_mapper.rs 74.00% 76.47% 61.11% 7.33%
/framework/base/src/storage/mappers/unordered_set_mapper.rs 83.33% 82.22% 86.36% 36.19%
/framework/base/src/storage/mappers/user_mapper.rs 79.20% 82.05% 75.00% 53.77%
/framework/base/src/storage/mappers/vec_mapper.rs 84.75% 76.92% 78.12% 31.74%
/framework/base/src/storage/mappers/whitelist_mapper.rs 100.00% 100.00% 100.00% 8.33%
/framework/base/src/storage/storage_get.rs 79.31% 81.58% 90.48% 44.55%
/framework/base/src/storage/storage_get_from_address.rs 76.11% 62.86% 72.22% 10.86%
/framework/base/src/storage/storage_key.rs 70.18% 64.29% 64.29% 62.89%
/framework/base/src/storage/storage_set.rs 94.05% 82.14% 100.00% 55.74%
/framework/base/src/tuple_util/nested_tuples.rs 86.67% 83.33% 77.78% 34.22%
/framework/base/src/types/crypto/message_hash_type.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/heap/arg_buffer.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/heap/async_call_result.rs 44.19% 38.71% 40.00% 25.00%
/framework/base/src/types/heap/queue.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/annotated.rs 100.00% 100.00% 100.00% 50.22%
/framework/base/src/types/interaction/annotated/annotated_impl_big_uint.rs 64.00% 59.09% 59.09% 34.51%
/framework/base/src/types/interaction/annotated/annotated_impl_managed_address.rs 64.29% 58.33% 58.33% 23.01%
/framework/base/src/types/interaction/annotated/annotated_impl_managed_buffer.rs 57.14% 66.67% 66.67% 42.42%
/framework/base/src/types/interaction/annotated/annotated_impl_time.rs 75.00% 75.00% 75.00% 50.00%
/framework/base/src/types/interaction/annotated/annotated_impl_token_identifier.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/annotated/annotated_impl_u64.rs 100.00% 100.00% 100.00% 68.42%
/framework/base/src/types/interaction/back_transfers.rs 80.00% 80.00% 80.00% 17.65%
/framework/base/src/types/interaction/callback_closure.rs 86.42% 85.71% 80.00% 22.98%
/framework/base/src/types/interaction/callback_selector_result.rs 100.00% 100.00% 100.00% 50.00%
/framework/base/src/types/interaction/expr/test_address.rs 83.13% 85.71% 82.35% 87.57%
/framework/base/src/types/interaction/expr/test_sc_address.rs 73.47% 69.57% 63.16% 84.78%
/framework/base/src/types/interaction/expr/test_token_identifier.rs 52.50% 50.00% 50.00% 71.83%
/framework/base/src/types/interaction/managed_arg_buffer.rs 59.62% 41.38% 57.58% 37.35%
/framework/base/src/types/interaction/markers/delegation_manager_address.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/markers/esdt_system_sc_address.rs 9.68% 12.50% 12.50% 1.27%
/framework/base/src/types/interaction/markers/gas_left.rs 50.00% 50.00% 50.00% 35.90%
/framework/base/src/types/interaction/markers/governance_sc_address.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/markers/system_sc_address.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/markers/to_caller.rs 58.82% 20.00% 25.00% 14.71%
/framework/base/src/types/interaction/markers/to_self.rs 58.82% 20.00% 25.00% 31.51%
/framework/base/src/types/interaction/markers/validator_sc_address.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/result_handlers/pass_value.rs 100.00% 100.00% 100.00% 33.33%
/framework/base/src/types/interaction/result_handlers/returns_bt.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_bt_egld.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_bt_legacy.rs 100.00% 100.00% 100.00% 25.00%
/framework/base/src/types/interaction/result_handlers/returns_bt_legacy_multi_esdt.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_bt_legacy_reset.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_bt_reset.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_bt_single_esdt.rs 100.00% 100.00% 100.00% 12.50%
/framework/base/src/types/interaction/result_handlers/returns_handled_or_err.rs 100.00% 100.00% 100.00% 29.03%
/framework/base/src/types/interaction/result_handlers/returns_new_address.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/result_handlers/returns_new_managed_address.rs 100.00% 100.00% 100.00% 42.86%
/framework/base/src/types/interaction/result_handlers/returns_raw_result.rs 100.00% 100.00% 100.00% 23.08%
/framework/base/src/types/interaction/result_handlers/returns_result.rs 100.00% 100.00% 100.00% 25.68%
/framework/base/src/types/interaction/result_handlers/returns_result_as.rs 72.73% 66.67% 66.67% 40.00%
/framework/base/src/types/interaction/result_handlers/returns_result_unmanaged.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/result_handlers/with_new_address.rs 66.67% 50.00% 50.00% 33.33%
/framework/base/src/types/interaction/result_handlers/with_raw_result.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/result_handlers/with_result.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/result_handlers/with_result_as.rs 60.00% 50.00% 50.00% 20.00%
/framework/base/src/types/interaction/system_proxy/builtin_func_proxy.rs 52.40% 53.33% 66.67% 22.22%
/framework/base/src/types/interaction/system_proxy/delegation_manager_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/delegation_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/esdt_system_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/governance_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/governance_sc_proxy/governance_config_result.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/governance_sc_proxy/proposal_view_result.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/token_properties.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/system_proxy/token_properties_result.rs 98.55% 89.47% 100.00% 44.44%
/framework/base/src/types/interaction/system_proxy/validator_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/tx.rs 84.15% 79.17% 80.85% 37.78%
/framework/base/src/types/interaction/tx_data.rs 16.67% 12.50% 25.00% 21.88%
/framework/base/src/types/interaction/tx_data/deploy_call.rs 66.67% 57.14% 57.14% 51.89%
/framework/base/src/types/interaction/tx_data/function_call.rs 96.12% 86.49% 92.86% 40.25%
/framework/base/src/types/interaction/tx_data/upgrade_call.rs 66.67% 57.14% 57.14% 28.17%
/framework/base/src/types/interaction/tx_exec.rs 100.00% 100.00% 100.00% 27.17%
/framework/base/src/types/interaction/tx_exec/tx_env_sc.rs 85.71% 75.00% 80.00% 62.87%
/framework/base/src/types/interaction/tx_exec/tx_exec_async.rs 92.65% 62.50% 90.00% 20.36%
/framework/base/src/types/interaction/tx_exec/tx_exec_async_promises.rs 85.71% 80.95% 80.00% 21.79%
/framework/base/src/types/interaction/tx_exec/tx_exec_deploy.rs 100.00% 100.00% 100.00% 28.10%
/framework/base/src/types/interaction/tx_exec/tx_exec_sync.rs 70.47% 77.27% 73.33% 24.39%
/framework/base/src/types/interaction/tx_exec/tx_exec_te.rs 86.44% 81.82% 81.82% 25.98%
/framework/base/src/types/interaction/tx_exec/tx_exec_upgrade.rs 41.67% 37.50% 40.00% 27.59%
/framework/base/src/types/interaction/tx_from.rs 20.00% 20.00% 20.00% 17.39%
/framework/base/src/types/interaction/tx_gas.rs 100.00% 100.00% 100.00% 53.54%
/framework/base/src/types/interaction/tx_payment.rs 48.48% 37.50% 50.00% 47.29%
/framework/base/src/types/interaction/tx_payment/test_esdt_transfer.rs 14.29% 33.33% 33.33% 53.85%
/framework/base/src/types/interaction/tx_payment/tx_payment_egld.rs 51.85% 48.15% 52.94% 21.24%
/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt.rs 39.02% 32.35% 31.82% 15.23%
/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs 66.67% 66.67% 61.54% 17.12%
/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt.rs 36.59% 20.00% 20.00% 8.11%
/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_ref.rs 34.55% 23.53% 20.00% 11.54%
/framework/base/src/types/interaction/tx_payment/tx_payment_multi_egld_or_esdt.rs 76.06% 58.82% 56.25% 10.70%
/framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs 72.30% 71.43% 68.75% 26.54%
/framework/base/src/types/interaction/tx_payment/tx_payment_none.rs 62.22% 62.50% 57.14% 26.16%
/framework/base/src/types/interaction/tx_payment/tx_payment_not_payable.rs 39.13% 33.33% 33.33% 31.08%
/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt.rs 50.00% 50.00% 50.00% 23.81%
/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs 76.19% 92.31% 83.33% 20.13%
/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_triple.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/interaction/tx_result_handler_list/original_result.rs 100.00% 100.00% 100.00% 43.59%
/framework/base/src/types/interaction/tx_result_handler_list/tx_result_handler_list_cons.rs 76.32% 70.00% 70.00% 46.50%
/framework/base/src/types/interaction/tx_result_handler_list/tx_result_handler_list_exec.rs 100.00% 100.00% 100.00% 46.43%
/framework/base/src/types/interaction/tx_to.rs 100.00% 100.00% 100.00% 22.24%
/framework/base/src/types/io/operation_completion_status.rs 98.72% 93.94% 100.00% 53.12%
/framework/base/src/types/io/sc_error_managed.rs 54.76% 50.00% 50.00% 14.29%
/framework/base/src/types/io/sc_error_static.rs 75.00% 71.43% 71.43% 28.57%
/framework/base/src/types/io/sc_result.rs 65.85% 60.42% 60.00% 33.33%
/framework/base/src/types/managed/basic/big_float.rs 56.41% 50.00% 54.35% 33.13%
/framework/base/src/types/managed/basic/big_float_cmp.rs 62.79% 62.50% 60.00% 30.00%
/framework/base/src/types/managed/basic/big_float_operators.rs 83.33% 80.00% 80.00% 40.35%
/framework/base/src/types/managed/basic/big_int.rs 86.76% 81.25% 82.05% 44.98%
/framework/base/src/types/managed/basic/big_int_cmp.rs 100.00% 100.00% 100.00% 35.71%
/framework/base/src/types/managed/basic/big_int_operators.rs 71.43% 55.56% 55.56% 3.89%
/framework/base/src/types/managed/basic/big_int_sign.rs 59.18% 70.83% 55.56% 10.42%
/framework/base/src/types/managed/basic/big_num_cmp.rs 72.00% 80.00% 66.67% 50.00%
/framework/base/src/types/managed/basic/cast_to_i64.rs 100.00% 100.00% 100.00% 27.47%
/framework/base/src/types/managed/basic/elliptic_curve.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/managed/basic/managed_buffer.rs 84.75% 81.65% 83.61% 61.53%
/framework/base/src/types/managed/basic/managed_map.rs 67.24% 54.55% 54.55% 25.53%
/framework/base/src/types/managed/codec_util/managed_buffer_nested_de_input.rs 94.23% 78.12% 100.00% 27.47%
/framework/base/src/types/managed/codec_util/managed_buffer_nested_en_output.rs 95.45% 87.50% 100.00% 65.25%
/framework/base/src/types/managed/codec_util/managed_buffer_top_de_input.rs 74.68% 77.78% 91.67% 27.82%
/framework/base/src/types/managed/codec_util/managed_buffer_top_en_output.rs 82.14% 73.68% 100.00% 65.96%
/framework/base/src/types/managed/managed_type_trait.rs 100.00% 100.00% 100.00% 52.21%
/framework/base/src/types/managed/multi_value/async_call_result_managed.rs 30.23% 37.50% 20.00% 19.54%
/framework/base/src/types/managed/multi_value/egld_or_esdt_token_payment_multi_value.rs 72.73% 64.29% 60.00% 18.18%
/framework/base/src/types/managed/multi_value/esdt_token_payment_multi_value.rs 59.09% 57.14% 40.00% 13.64%
/framework/base/src/types/managed/multi_value/multi_value_encoded.rs 92.48% 85.96% 92.00% 22.25%
/framework/base/src/types/managed/multi_value/multi_value_encoded_counted.rs 54.95% 47.37% 38.89% 6.25%
/framework/base/src/types/managed/multi_value/multi_value_encoded_iter.rs 100.00% 100.00% 100.00% 17.70%
/framework/base/src/types/managed/multi_value/multi_value_managed_vec.rs 49.58% 48.94% 45.16% 12.64%
/framework/base/src/types/managed/multi_value/multi_value_managed_vec_counted.rs 70.97% 68.97% 64.29% 7.38%
/framework/base/src/types/managed/wrapped/big_uint.rs 96.61% 89.86% 97.62% 56.07%
/framework/base/src/types/managed/wrapped/big_uint_cmp.rs 100.00% 100.00% 100.00% 53.74%
/framework/base/src/types/managed/wrapped/big_uint_operators.rs 88.62% 85.71% 85.71% 19.03%
/framework/base/src/types/managed/wrapped/builder/managed_buffer_builder.rs 65.93% 52.78% 71.43% 63.03%
/framework/base/src/types/managed/wrapped/builder/managed_buffer_builder_impl_basic.rs 100.00% 100.00% 100.00% 70.37%
/framework/base/src/types/managed/wrapped/builder/managed_buffer_builder_impl_cached.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/managed/wrapped/encoded_managed_vec_item.rs 75.00% 75.00% 75.00% 42.86%
/framework/base/src/types/managed/wrapped/managed_address.rs 95.31% 90.24% 93.75% 48.14%
/framework/base/src/types/managed/wrapped/managed_buffer_read_to_end.rs 94.87% 86.67% 100.00% 5.33%
/framework/base/src/types/managed/wrapped/managed_byte_array.rs 87.39% 80.43% 82.61% 44.70%
/framework/base/src/types/managed/wrapped/managed_decimal.rs 78.54% 65.22% 77.14% 28.91%
/framework/base/src/types/managed/wrapped/managed_decimal/decimals.rs 100.00% 100.00% 100.00% 42.94%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_cmp.rs 37.04% 40.00% 50.00% 50.00%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_cmp_signed.rs 37.04% 40.00% 50.00% 77.78%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_logarithm.rs 75.68% 64.29% 66.67% 28.57%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_add.rs 40.00% 50.00% 50.00% 20.00%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_add_signed.rs 13.33% 10.00% 16.67% 7.69%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_div.rs 48.00% 50.00% 50.00% 25.00%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_div_signed.rs 24.00% 16.67% 16.67% 7.69%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_mul.rs 40.00% 50.00% 50.00% 29.41%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_mul_signed.rs 20.00% 16.67% 16.67% 7.69%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_sub.rs 30.00% 40.00% 33.33% 17.65%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_op_sub_signed.rs 13.33% 10.00% 16.67% 7.69%
/framework/base/src/types/managed/wrapped/managed_decimal/managed_decimal_signed.rs 53.11% 37.04% 45.24% 30.10%
/framework/base/src/types/managed/wrapped/managed_map_encoded.rs 100.00% 100.00% 100.00% 66.67%
/framework/base/src/types/managed/wrapped/managed_option.rs 61.33% 67.14% 56.25% 38.48%
/framework/base/src/types/managed/wrapped/managed_ref.rs 89.29% 83.33% 83.33% 55.22%
/framework/base/src/types/managed/wrapped/managed_ref_mut.rs 23.21% 25.00% 25.00% 26.76%
/framework/base/src/types/managed/wrapped/managed_vec.rs 97.79% 92.65% 100.00% 41.51%
/framework/base/src/types/managed/wrapped/managed_vec_item.rs 83.33% 75.00% 75.00% 45.37%
/framework/base/src/types/managed/wrapped/managed_vec_item_nested_tuple.rs 100.00% 100.00% 100.00% 100.00%
/framework/base/src/types/managed/wrapped/managed_vec_item_payload.rs 67.35% 55.00% 55.00% 51.75%
/framework/base/src/types/managed/wrapped/managed_vec_iter_owned.rs 80.00% 69.57% 75.00% 39.40%
/framework/base/src/types/managed/wrapped/managed_vec_iter_payload.rs 95.08% 92.86% 87.50% 54.38%
/framework/base/src/types/managed/wrapped/managed_vec_iter_ref.rs 97.87% 96.00% 100.00% 42.63%
/framework/base/src/types/managed/wrapped/managed_vec_ref.rs 87.50% 83.33% 83.33% 37.63%
/framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs 90.32% 80.00% 80.00% 28.57%
/framework/base/src/types/managed/wrapped/preloaded_managed_buffer.rs 0.00% 0.00% 0.00% 0.00%
/framework/base/src/types/managed/wrapped/randomness_source.rs 52.11% 53.85% 53.85% 23.53%
/framework/base/src/types/managed/wrapped/token/egld_or_esdt_token_identifier.rs 81.65% 77.01% 78.72% 44.90%
/framework/base/src/types/managed/wrapped/token/egld_or_esdt_token_payment.rs 81.82% 71.43% 65.52% 27.16%
/framework/base/src/types/managed/wrapped/token/egld_or_multi_esdt_payment.rs 24.14% 19.05% 11.11% 3.70%
/framework/base/src/types/managed/wrapped/token/esdt_token_data.rs 27.59% 22.22% 22.22% 11.11%
/framework/base/src/types/managed/wrapped/token/esdt_token_identifier.rs 83.09% 85.19% 81.25% 45.60%
/framework/base/src/types/managed/wrapped/token/esdt_token_payment.rs 81.88% 63.64% 68.00% 38.48%
/framework/base/src/types/managed/wrapped/token/multi_egld_or_esdt_token_payment.rs 95.65% 93.33% 100.00% 24.14%
/framework/base/src/types/managed/wrapped/traits/fixed_token_supply.rs 95.00% 85.71% 100.00% 33.33%
/framework/base/src/types/managed/wrapped/traits/mergeable.rs 11.76% 11.76% 14.29% 6.25%
/framework/base/src/types/math_util/logarithm_i64.rs 100.00% 100.00% 100.00% 50.00%
/framework/base/src/types/static_buffer/lockable_static_buffer.rs 57.65% 55.56% 50.00% 25.71%
/framework/base/src/types/static_buffer/sparse_array.rs 44.00% 43.75% 50.00% 20.00%
/framework/base/src/types/static_buffer/static_buffer_ref.rs 68.83% 68.29% 65.38% 50.94%
/framework/derive/src/contract_impl.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/format/format_args_macro.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/format/format_parts.rs 61.26% 38.71% 80.00% 80.00%
/framework/derive/src/format/format_tokenize.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/format/managed_decimal_macro.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/format/semver_tuple.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/abi_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/auto_impl.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/auto_impl_event.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/auto_impl_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/auto_impl_storage.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/callback_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/contract_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/convert_to_owned_type.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/endpoints_mod_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/function_selector.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/method_call_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/method_call_gen_arg.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/method_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/payable_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/proxy_callback_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/proxy_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/restricted_caller_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/snippets.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/supertrait_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/generate/util.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/macro_contract.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/macro_module.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/macro_proxy.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/managed_vec_item_derive.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/argument.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/contract_trait.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/endpoint_mutability_metadata.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/endpoint_type_metadata.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/method.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/model/payable.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/argument_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/argument_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/doc_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/endpoint_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/event_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/label_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/payable_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/storage_attr.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/trait_argument_prop.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/attributes/util.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/auto_impl_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/contract_trait_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/endpoint_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/method_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/parse_util.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/payable_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/split_path.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/supertrait_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/parse/trait_argument_parse.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/preprocessing/mod.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/preprocessing/substitution_algorithm.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/preprocessing/substitution_key.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/preprocessing/substitution_list.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/preprocessing/substitution_map.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/type_abi_derive.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/validate/reserved.rs 0.00% 0.00% 0.00% 0.00%
/framework/derive/src/validate/validate_method.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/abi_json.rs 88.00% 75.00% 66.67% 28.57%
/framework/meta-lib/src/abi_json/build_info_abi_json.rs 43.84% 36.36% 36.36% 18.18%
/framework/meta-lib/src/abi_json/contract_abi_json.rs 90.43% 80.00% 57.14% 33.33%
/framework/meta-lib/src/abi_json/endpoint_abi_json.rs 38.89% 56.86% 40.00% 20.00%
/framework/meta-lib/src/abi_json/esdt_attribute_abi_json.rs 46.15% 50.00% 50.00% 25.00%
/framework/meta-lib/src/abi_json/esdt_attribute_json.rs 37.50% 33.33% 33.33% 16.67%
/framework/meta-lib/src/abi_json/event_abi_json.rs 37.14% 46.15% 25.00% 12.50%
/framework/meta-lib/src/abi_json/type_abi_json.rs 91.73% 83.64% 84.62% 42.31%
/framework/meta-lib/src/cargo_toml/cargo_toml_contents.rs 67.01% 44.66% 51.52% 30.88%
/framework/meta-lib/src/cargo_toml/cargo_toml_deps.rs 33.33% 47.06% 33.33% 33.33%
/framework/meta-lib/src/cargo_toml/cargo_toml_deps_raw.rs 75.36% 72.58% 75.00% 50.00%
/framework/meta-lib/src/cargo_toml/version_req.rs 37.93% 42.86% 50.00% 25.00%
/framework/meta-lib/src/cli/cli_args_build.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/cli/cli_args_contract.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/cli/cli_contract_main.rs 26.83% 7.14% 33.33% 57.14%
/framework/meta-lib/src/code_report_json.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_proxy/proxy_gen_main.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_proxy/proxy_generator.rs 14.71% 6.99% 10.20% 5.10%
/framework/meta-lib/src/contract/generate_proxy/proxy_process_type_name.rs 35.80% 27.08% 42.86% 21.43%
/framework/meta-lib/src/contract/generate_snippets/snippet_crate_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_snippets/snippet_gen_common.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_snippets/snippet_gen_main.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_snippets/snippet_sc_functions_gen.rs 0.00% 0.00% 0.00% 0.00%
/framework/meta-lib/src/contract/generate_snippet...[Comment body truncated]

@github-actions
Copy link

github-actions bot commented Feb 25, 2025

Contract comparison - from 87227c5 to 9fcc9cb

Path                                                                                             size                  has-allocator                     has-format
fractional-nfts.wasm 8479 false without message
multisig-view.wasm 5590 false None
multisig-full.wasm 15107 false without message
multisig.wasm 13606 false without message
nft-minter.wasm 9813 false without message
ping-pong-egld.wasm 6397 false None
crowdfunding-esdt.wasm 3671 false None
factorial.wasm 579 false None
nft-subscription.wasm 8772 false without message
kitty-auction.wasm 9394 false without message
kitty-genetic-alg.wasm 3494 false without message
kitty-ownership.wasm 12953 false without message
nft-storage-prepay.wasm 2609 false None
crypto-bubbles.wasm 2561 false None
esdt-transfer-with-fee.wasm 7567 false without message
seed-nft-minter.wasm 14216 false without message
adder.wasm 699 false None
bonding-curve-contract.wasm 14054 false None
proxy-pause.wasm 4165 false None
empty.wasm 244 false None
digital-cash.wasm 9723 false None
token-release.wasm 6994 false without message
lottery-esdt.wasm 10581 ➡️ 11550 🔴 (+969) false without message
rewards-distribution.wasm 9477 false without message
check-pause.wasm 1240 false None
order-book-factory.wasm 3376 false None
order-book-pair.wasm 13983 false None
crypto-zombies.wasm 9276 false without message
set-repeat.wasm 6459 false None
single-value-repeat.wasm 4301 false None
map-repeat.wasm 7311 false without message
queue-repeat.wasm 5546 false None
linked-list-repeat.wasm 6848 false without message
vec-repeat.wasm 4920 false None
str-repeat-mb-builder-cached.wasm 1109 false without message
str-repeat-mb-builder-basic.wasm 757 false None
str-repeat.wasm 2733 false without message
large-storage.wasm 1656 false None
send-tx-repeat.wasm 1292 false None
abi-tester.wasm 8682 true without message
abi-tester-ev.wasm 760 false None
exchange-features.wasm 1514 false None
use-module.wasm 32603 false without message
use-module-view.wasm 736 false None
panic-message-features.wasm 12838 false with message
panic-message-std.wasm 15886 false with message
big-float-features.wasm 6373 false without message
scenario-tester.wasm 1374 false None
forbidden-opcodes.wasm 842 false None
basic-features.wasm 71356 false without message
basic-features-storage-bytes.wasm 541 false None
payable-features.wasm 4904 false None
std-contract.wasm 3469 true without message
forwarder-queue.wasm 12619 false without message
forwarder-queue-promises.wasm 13309 false without message
forwarder-raw.wasm 15280 false None
forwarder-raw-init-sync-call.wasm 3019 false None
forwarder-raw-init-async-call.wasm 2473 false None
forwarder-legacy.wasm 32391 false without message
recursive-caller.wasm 5125 false without message
second-contract.wasm 1477 false None
first-contract.wasm 3603 false None
proxy-test-first.wasm 5711 false without message
transfer-role-features.wasm 8607 false without message
vault.wasm 8780 false None
vault-upgrade.wasm 708 false None
forwarder.wasm 48247 false without message
proxy-test-second.wasm 2327 false without message
local-esdt-and-nft.wasm 12433 false without message
parent.wasm 1999 false None
child.wasm 4369 false without message
builtin-func-features.wasm 3816 false None
rust-snippets-generator-test.wasm 4714 false None
rust-testing-framework-tester.wasm 8726 false None
multi-contract-features-view.wasm 1113 false None
multi-contract-features.wasm 681 false None
multi-contract-alt-impl.wasm 353 false None
multi-contract-example-feature.wasm 680 false None
alloc-mem-leaking.wasm 23325 false without message
alloc-features.wasm 23168 false without message
alloc-mem-fail.wasm 17720 true without message
erc1155-user-mock.wasm 1229 false None
erc721.wasm 2232 false None
crowdfunding-erc20.wasm 4909 false without message
lottery-erc20.wasm 12886 false without message
erc1155.wasm 11969 false without message
erc1155-marketplace.wasm 10573 false without message
erc20.wasm 1887 false None
esdt-system-sc-mock.wasm 4205 false None
formatted-message-features.wasm 3719 false without message
multiversx-price-aggregator-sc.wasm 17866 false without message
multiversx-wegld-swap-sc.wasm 4444 false None

@alyn509 alyn509 marked this pull request as ready for review March 4, 2025 09:42
@alyn509 alyn509 changed the base branch from master to rc/v0.57 March 4, 2025 09:45
Base automatically changed from rc/v0.57 to master March 11, 2025 08:29
dorin-iancu
dorin-iancu previously approved these changes Nov 18, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements fixes from a security audit for the lottery-esdt smart contract. The changes significantly refactor the contract architecture and address several security and functionality concerns identified in the audit.

Key Changes:

  • Refactored contract into modular structure (basics/ and specific/ modules) for better organization
  • Changed token support from EGLD/ESDT to ESDT-only (TokenIdentifier instead of EgldOrEsdtTokenIdentifier)
  • Implemented two-phase prize claiming mechanism: prizes accumulate in storage, users explicitly claim rewards
  • Introduced address-to-ID mapping for storage optimization
  • Made determine_winner callable multiple times with MAX_OPERATIONS limit per call for better gas management
  • Renamed endpoint from "start"/"createLotteryPool" to "startLottery" for consistency
  • Added shard validation requirement for determine_winner calls

Reviewed changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/lottery.rs Complete refactor from monolithic to modular trait composition architecture
src/specific/award.rs New awarding module with batched prize distribution and accumulated rewards pattern
src/specific/claim.rs New claim module allowing users to withdraw accumulated rewards
src/specific/buy.rs Extracted ticket purchase logic with address-to-ID mapper integration
src/specific/setup.rs Extracted lottery setup logic, enforces ESDT-only tokens
src/basics/storage.rs Centralized storage mappers using u64 IDs instead of addresses
src/basics/utils.rs Refactored random selection from array-based to single random value
src/lottery_proxy.rs Auto-generated proxy file (has type mismatches with actual contract)
scenarios/*.scen.json Updated test scenarios to reflect new storage patterns and shard requirements
wasm/src/lib.rs Updated endpoint list order and naming
tests/*.rs Added ignore attributes for tests requiring shard simulation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

info.unawarded_amount -= prize;
} else {
// insert token in accumulated rewards first place
let first_place_winner = ticket_holders_mapper.get(*index_last_winner);
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Using index_last_winner to access ticket_holders_mapper.get(*index_last_winner) when *index_last_winner > total_winning_tickets could be accessing an index that has already been used in a previous iteration. Since the first place winner should receive any leftover unawarded_amount, the correct index should be 1 (the first winner), not *index_last_winner. This bug would result in giving leftover funds to the wrong winner.

Copilot uses AI. Check for mistakes.
total_winning_tickets: usize,
info: &mut LotteryInfo<Self::Api>,
) {
let rand_index = self.get_distinct_random(*index_last_winner, total_tickets);
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The function get_distinct_random is called with parameters (min: *index_last_winner, max: total_tickets) but based on the usage pattern and the need to select a random ticket holder, this should likely be called with (min: *index_last_winner, max: total_tickets + 1) or the implementation of get_distinct_random needs to be verified for inclusive/exclusive range handling. The old implementation returned ArrayVec with shuffled indices, but the new implementation just returns a single random value. Verify that the random selection correctly covers the intended range.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +16
#[storage_mapper("totalWinning_tickets")]
fn total_winning_tickets(&self, lottery_name: &ManagedBuffer) -> SingleValueMapper<usize>;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The storage mapper key has an inconsistent naming format: "totalWinning_tickets" uses an underscore between words, while other mappers use camelCase (e.g., "ticketHolder", "indexLastWinner"). This inconsistency could lead to confusion. Consider using "totalWinningTickets" for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +158 to +182
if *index_last_winner <= total_winning_tickets {
let prize = self.calculate_percentage_of(
&info.prize_pool,
&BigUint::from(
info.prize_distribution
.get(total_winning_tickets - *index_last_winner),
),
);
if prize == 0 {
return;
}

self.assign_prize_to_winner(info.token_identifier.clone(), &prize, &winner_address);

info.unawarded_amount -= prize;
} else {
// insert token in accumulated rewards first place
let first_place_winner = ticket_holders_mapper.get(*index_last_winner);

self.assign_prize_to_winner(
info.token_identifier.clone(),
&info.unawarded_amount,
&first_place_winner,
);
}
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The condition 'if *index_last_winner <= total_winning_tickets' will always be true within the award_winner function because the calling loop at line 98 only invokes award_winner when this condition holds. The else branch (lines 173-182) is unreachable dead code. This suggests a logic error in how the first place winner receives leftover unawarded_amount. Consider moving the leftover distribution logic outside the loop or restructuring to execute after all winners are processed.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +47
require!(
!self.accumulated_rewards(&token_id, caller_id).is_empty(),
"Token requested not available for claim"
);
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The error message "Token requested not available for claim" is misleading in this context. This error is triggered in handle_claim_with_unspecified_tokens when the user didn't specify any tokens (claiming all). A more accurate message would be "Internal error: token in reward set has no balance" or the check should be removed since user_accumulated_token_rewards should only contain tokens with non-empty balances.

Copilot uses AI. Check for mistakes.
caller_id: &u64,
accumulated_rewards: &mut MultiEsdtPayment<Self::Api>,
) {
for token_id in tokens.iter().rev() {
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Iterating tokens in reverse order with .rev() is unnecessary here and may cause confusion. The order of iteration doesn't affect the correctness of the claim operation, and reversing adds unnecessary complexity. Consider removing .rev() for clearer code unless there's a specific reason for reverse iteration.

Copilot uses AI. Check for mistakes.
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.

3 participants