why is msg.value < mintFee ?? #2099
-
function requestNft() public payable returns (uint256 requestId) {
if (msg.value < i_mintFee) {
revert NeedMoreETHSent();
}
requestId = i_vrfCoordinator.requestRandomWords(
i_gasLane,
i_subscriptionId,
REQUEST_CONFIRMATIONS,
i_callbackGasLimit,
NUM_WORDS
);
s_requestIdToSender[requestId] = msg.sender;
emit NftRequested(requestId, msg.sender);
}
Here mintFee is the limit to cross right ? so we must send eth equal to or greater than ? |
Beta Was this translation helpful? Give feedback.
Answered by
SidharthK2
Aug 27, 2022
Replies: 1 comment 2 replies
-
This If statement reverts with an error if msg.value if less than the mint fee, If msg.value is greater, the rest of the code is executed. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
sadath-12
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This If statement reverts with an error if msg.value if less than the mint fee, If msg.value is greater, the rest of the code is executed.