I'm having a This transaction is expected to fail. Trying to execute it is expected to be expensive but fail, and is not recommended.
(max gas fee error)
Only on mainnet (on testnet it works propperly)
with this function
function MintPresale() noReentrant public payable{
require(nextId<25000, 'Presale ended');
uint256 cost = GetMintcost() * 49 / 50;
require(msg.value >= cost , 'insufficient transfer'); //check if has tokens
require(balanceOf(msg.sender)<=4, 'Reached Max number of Mints');
bool sent = vault.send(msg.value);
require(sent, "Failed to send BNB");
nextId++;
_safeMint(msg.sender, nextId -1);
emit MintEvent(msg.sender, block.timestamp);
}
Do you know why it is happening?
Feb 21, 2022, 2:27 PM
network?
Feb 21, 2022, 2:42 PM
maybe presale ended?
Feb 21, 2022, 2:56 PM
BSC
I've debugged almost everything
the error is here
bool sent = vault.send(msg.value);
require(sent, "Failed to send BNB");
require(sent, "Failed to send BNB");
but i don't know what's wrong with that code
Feb 21, 2022, 3:15 PM
Vault is in payable??
Feb 21, 2022, 3:29 PM