I am confused with the following sentence in the Solidity documentation:
During the execution of the fallback function, the contract can only rely on the “gas stipend” it is passed (2300 gas) being available to it at that time.
My post is a continuation of this one. This post has an answer which says
The 'stipend' applies to internal sends from one smart contract to another. Because send has no way to specify the gas amount, (whereas call does), Solidity imposes a maximum amount of gas (i.e. 2300).
Because the OP's transaction was not an internal contract-to-contract send the 2300 stipend did not apply and the transaction went through.
So, what does "internal" mean?
Suppose I (as an EOA) sign a transaction TX1 and broadcast it. This TX1 executes a function foo
within a contract A which transfers, say ethers, to another contract B.
contract contractA
{
//...
function foo() external
{
//...
contractB.transfer(1 ether);
}
//...
}
Is contractB.transfer(1 ether);
internal call? My guess it is external call because it calls on another contract.
What is the meaning of stipend if transactions always have gas limit set by sender? When, in what cases, does this damn 'stipend' apply?
Could someone please provide a piece of code or describe a scenario when 2300 stipend is not enough, and when we set gasLimit which is enough to execute transfer
function?