my question is if "THROW" is deprecated then what i have to put instead throw in the following solidity code ?
// This function creates Tokens
function createTokens() payable {
if(isMinting == true){
require(msg.value > 0);
uint256 tokens = msg.value.div(100000000000000).mul(RATE);
balances[msg.sender] = balances[msg.sender].add(tokens);
_totalSupply = _totalSupply.add(tokens);
owner.transfer(msg.value);
}
else{
throw;
}
}
so the code should look like this:
// This function creates Tokens
function createTokens() payable {
require(isMinting == true && msg.value > 0);
uint256 tokens = msg.value.div(100000000000000).mul(RATE);
balances[msg.sender] = balances[msg.sender].add(tokens);
_totalSupply = _totalSupply.add(tokens);
owner.transfer(msg.value);
}
else{
throw;
}
}
Or i have to delete the
else{
throw;
last update:
function createTokens() payable public {
if(isMinting == true){
require(isMinting, "Not allowed");
require(msg.value > 0, "No funds");
uint256 tokens = msg.value.div(100000000000000).mul(RATE);
balances[msg.sender] = balances[msg.sender].add(tokens);
_totalSupply = _totalSupply.add(tokens);
owner.transfer(msg.value);
}
else{
revert();
}
thanks AK