Skip to content

Commit

Permalink
fix: update RandomnessLotteryDemo TODOs
Browse files Browse the repository at this point in the history
- Set safe gas limit (200,000) for fulfillment operations
- Replace hardcoded deposit with actual contract call
  • Loading branch information
VolodymyrBg authored Jan 18, 2025
1 parent e167a3a commit ea6d86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/contracts/src/RandomnessLotteryDemo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract RandomnessLotteryDemo is RandomnessConsumer {
/// @dev this limit based on the size of the request and the processing of the
/// @dev callback request in the fulfillRandomWords() function.
/// @dev The fee paid to start the lottery needs to be sufficient to pay for the gas limit
uint64 public FULFILLMENT_GAS_LIMIT = 100000; // TODO: fill XXX
uint64 public FULFILLMENT_GAS_LIMIT = 200000; // Safe gas limit for processing NUM_WINNERS random words and transferring rewards

/// @notice The minimum fee needed to start the lottery
/// @dev This does not guarantee that there will be enough fee to pay for the
Expand Down Expand Up @@ -188,7 +188,7 @@ contract RandomnessLotteryDemo is RandomnessConsumer {
/// We verify there is enough balance on the contract to pay for the deposit.
/// This would fail only if the deposit amount required is changed in the
/// Randomness Precompile.
uint256 requiredDeposit = 1000000000000000000; // TODO replace with RANDOMNESS_CONTRACT.requiredDeposit();
uint256 requiredDeposit = RANDOMNESS_CONTRACT.requiredDeposit();
if (address(this).balance < jackpot + requiredDeposit) {
revert DepositTooLow(
address(this).balance - jackpot,
Expand Down

0 comments on commit ea6d86e

Please sign in to comment.