I'm currently working on a smart-contract, and I have this warning in Remix :
Fallback function of contract browser/token.sol requires too much gas
(102480).
If the fallback function requires more than 2300 gas, the contract
cannot receive Ether.
I understand that, when executing the fallback method, I'm in a context of limited available gas. But for a token creation, for instance, I need to write multiple variables to have an accurate accounting of my token distribution.
function() payable {
require(block.number > icoStartBlock && block.number < icoEndBlock);
uint256 tokenAmount = msg.value * ((block.number < icoPremiumEndBlock) ? 550 : 500);
shares[msg.sender] += msg.value;
balances[msg.sender] += tokenAmount;
balances[owner] += tokenAmount / 6;
raised += msg.value;
created += tokenAmount;
}
If the user that send Ether to my smart-contract know there is a need for more gas, will it be working if he sends more ? Am I doing an anti-pattern ? The the contract cannot receive Ether part of the message on Remix is scaring me a bit.