From ab2c7a8ef3b9615a84d0152365b1f2cc36b0f651 Mon Sep 17 00:00:00 2001 From: Vinay Pulim Date: Mon, 8 Oct 2018 13:42:52 -0400 Subject: [PATCH] Add Constantinople SSTORE gas/refund prices (EIP1283) --- hardforks/constantinople.json | 31 ++++++++++++++++++++++++++++++- tests/params.js | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/hardforks/constantinople.json b/hardforks/constantinople.json index e718141..a1f0a05 100644 --- a/hardforks/constantinople.json +++ b/hardforks/constantinople.json @@ -6,7 +6,36 @@ "status": "Draft" }, "gasConfig": {}, - "gasPrices": {}, + "gasPrices": { + "netSstoreNoopGas": { + "v": 200, + "d": "Once per SSTORE operation if the value doesn't change" + }, + "netSstoreInitGas": { + "v": 20000, + "d": "Once per SSTORE operation from clean zero" + }, + "netSstoreCleanGas": { + "v": 5000, + "d": "Once per SSTORE operation from clean non-zero" + }, + "netSstoreDirtyGas": { + "v": 200, + "d": "Once per SSTORE operation from dirty" + }, + "netSstoreClearRefund": { + "v": 15000, + "d": "Once per SSTORE operation for clearing an originally existing storage slot" + }, + "netSstoreResetRefund": { + "v": 4800, + "d": "Once per SSTORE operation for resetting to the original non-zero value" + }, + "netSstoreResetClearRefund": { + "v": 19800, + "d": "Once per SSTORE operation for resetting to the original zero value" + } + }, "vm": {}, "pow": { "minerReward": { diff --git a/tests/params.js b/tests/params.js index 1b047df..8426af8 100644 --- a/tests/params.js +++ b/tests/params.js @@ -34,6 +34,7 @@ tape('[Common]: Parameter access', function (t) { st.equal(c.param('pow', 'minerReward', 'chainstart'), '5000000000000000000', 'Should return correct value for chain start') st.equal(c.param('pow', 'minerReward', 'byzantium'), '3000000000000000000', 'Should reflect HF update changes') + st.equal(c.param('gasPrices', 'netSstoreNoopGas', 'constantinople'), 200, 'Should return updated sstore gas prices for constantinople') st.end() })