Skip to content

Commit

Permalink
[M-1] Low hardcoded REQUEST_CONFIRMATIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed Apr 17, 2023
1 parent 7896821 commit 8d15f1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/pack-plugin/extension/PackVRFDirectLogic.sol
Expand Up @@ -69,7 +69,7 @@ contract PackVRFDirectLogic is
//////////////////////////////////////////////////////////////*/

uint32 private constant CALLBACKGASLIMIT = 100_000;
uint16 private constant REQUEST_CONFIRMATIONS = 3;
uint16 private constant REQUEST_CONFIRMATIONS = 5;
uint32 private constant NUMWORDS = 1;

/// @dev Emitted when admin deposits Link tokens.
Expand Down Expand Up @@ -229,7 +229,8 @@ contract PackVRFDirectLogic is
require(packVrfData.linkBalance >= requestPrice, "Insufficient LINK balance");

// Request VRF for randomness.
requestId = requestRandomness(_callBackGasLimit, REQUEST_CONFIRMATIONS, NUMWORDS);
uint16 requestConfirmations = (block.chainid == 137 || block.chainid == 80001) ? 15 : REQUEST_CONFIRMATIONS;
requestId = requestRandomness(_callBackGasLimit, requestConfirmations, NUMWORDS);
require(requestId > 0, "!VRF");

// Mark request as active; store request parameters.
Expand Down

0 comments on commit 8d15f1a

Please sign in to comment.