diff --git a/libevmasm/EVMSchedule.h b/libevmasm/EVMSchedule.h index ce9003bdd..65d307ae9 100644 --- a/libevmasm/EVMSchedule.h +++ b/libevmasm/EVMSchedule.h @@ -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; diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 5cb25a22c..e4fe77014 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -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. diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index 7c6a04ce6..146f08a21 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -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; diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp index 87bdb643c..5e92c6e66 100644 --- a/libevmasm/Instruction.cpp +++ b/libevmasm/Instruction.cpp @@ -297,7 +297,7 @@ static const std::map 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(