libevmasm: EIP150.a changes on SLOAD, CALL, CALLCODE, DELEGATECALL and SUICIDE

This commit is contained in:
Yoichi Hirai 2017-01-16 14:49:14 +01:00 committed by chriseth
parent f2775f82d0
commit e54a3ead16
4 changed files with 6 additions and 3 deletions

View File

@ -34,7 +34,7 @@ struct EVMSchedule
unsigned expByteGas = 10;
unsigned sha3Gas = 30;
unsigned sha3WordGas = 6;
unsigned sloadGas = 50;
unsigned sloadGas = 200;
unsigned sstoreSetGas = 20000;
unsigned sstoreResetGas = 5000;
unsigned sstoreRefundGas = 15000;

View File

@ -149,6 +149,8 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
}
break;
}
case Instruction::SELFDESTRUCT:
gas = GasCosts::selfdestructGas;
case Instruction::CREATE:
if (_includeExternalCosts)
// We assume that we do not know the target contract and thus, the consumption is infinite.

View File

@ -59,10 +59,11 @@ namespace GasCosts
static unsigned const logDataGas = 8;
static unsigned const logTopicGas = 375;
static unsigned const createGas = 32000;
static unsigned const callGas = 40;
static unsigned const callGas = 700;
static unsigned const callStipend = 2300;
static unsigned const callValueTransferGas = 9000;
static unsigned const callNewAccountGas = 25000;
static unsigned const selfdestructGas = 5000;
static unsigned const selfdestructRefundGas = 24000;
static unsigned const memoryGas = 3;
static unsigned const quadCoeffDiv = 512;

View File

@ -297,7 +297,7 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
{ Instruction::DELEGATECALL, { "DELEGATECALL", 0, 6, 1, true, Tier::Special } },
{ Instruction::REVERT, { "REVERT", 0, 2, 0, true, Tier::Zero } },
{ Instruction::INVALID, { "INVALID", 0, 0, 0, true, Tier::Zero } },
{ Instruction::SELFDESTRUCT, { "SELFDESTRUCT", 0, 1, 0, true, Tier::Zero } }
{ Instruction::SELFDESTRUCT, { "SELFDESTRUCT", 0, 1, 0, true, Tier::Special } }
};
void dev::solidity::eachInstruction(