Merge pull request #2682 from ethereum/delegatecall-newaccount

Provide new account gas for low-level callcode/delegatecall
This commit is contained in:
chriseth authored and GitHub committed 2017-08-01 17:19:32 +02:00
commit 3aacfc7e35
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -3,6 +3,7 @@
Features:
Bugfixes:
* Code Generator: Provide "new account gas" for low-level ``callcode`` and ``delegatecall``.
### 0.4.14 (2017-07-31)
+1 -1
View File
@@ -1712,7 +1712,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
u256 gasNeededByCaller = eth::GasCosts::callGas + 10;
if (_functionType.valueSet())
gasNeededByCaller += eth::GasCosts::callValueTransferGas;
if (!isCallCode && !isDelegateCall && !existenceChecked)
if (!existenceChecked)
gasNeededByCaller += eth::GasCosts::callNewAccountGas; // we never know
m_context << gasNeededByCaller << Instruction::GAS << Instruction::SUB;
}