aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-01-16 21:49:14 +0800
committerchriseth <chris@ethereum.org>2017-04-25 22:14:58 +0800
commite54a3ead16322d6ff816187ad778166271cadb01 (patch)
treeaf62a1db5590a25dd465e388c8c34ff28194abe6
parentf2775f82d02336ef8ec64ec391e8433448b2afd8 (diff)
downloaddexon-solidity-e54a3ead16322d6ff816187ad778166271cadb01.tar.gz
dexon-solidity-e54a3ead16322d6ff816187ad778166271cadb01.tar.zst
dexon-solidity-e54a3ead16322d6ff816187ad778166271cadb01.zip
libevmasm: EIP150.a changes on SLOAD, CALL, CALLCODE, DELEGATECALL and SUICIDE
-rw-r--r--libevmasm/EVMSchedule.h2
-rw-r--r--libevmasm/GasMeter.cpp2
-rw-r--r--libevmasm/GasMeter.h3
-rw-r--r--libevmasm/Instruction.cpp2
4 files changed, 6 insertions, 3 deletions
diff --git a/libevmasm/EVMSchedule.h b/libevmasm/EVMSchedule.h
index ce9003bd..65d307ae 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 5cb25a22..e4fe7701 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 7c6a04ce..146f08a2 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 87bdb643..5e92c6e6 100644
--- a/libevmasm/Instruction.cpp
+++ b/libevmasm/Instruction.cpp
@@ -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(