github.com/SmartMeshFoundation/Spectrum@v0.0.0-20220621030607-452a266fee1e/params/gas_table.go (about)

     1  // Copyright 2016 The Spectrum Authors
     2  // This file is part of the Spectrum library.
     3  //
     4  // The Spectrum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The Spectrum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the Spectrum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package params
    18  
    19  type GasTable struct {
    20  	ExtcodeSize uint64
    21  	ExtcodeCopy uint64
    22  	Balance     uint64
    23  	SLoad       uint64
    24  	Calls       uint64
    25  	Suicide     uint64
    26  
    27  	ExpByte uint64
    28  
    29  	// CreateBySuicide occurs when the
    30  	// refunded account is one that does
    31  	// not exist. This logic is similar
    32  	// to call. May be left nil. Nil means
    33  	// not charged.
    34  	CreateBySuicide uint64
    35  }
    36  
    37  var (
    38  	// GasTableHomestead contain the gas prices for
    39  	// the homestead phase.
    40  	GasTableHomestead = GasTable{
    41  		ExtcodeSize: 20,
    42  		ExtcodeCopy: 20,
    43  		Balance:     20,
    44  		SLoad:       50,
    45  		Calls:       40,
    46  		Suicide:     0,
    47  		ExpByte:     10,
    48  	}
    49  
    50  	// GasTableHomestead contain the gas re-prices for
    51  	// the homestead phase.
    52  	GasTableEIP150 = GasTable{
    53  		ExtcodeSize: 700,
    54  		ExtcodeCopy: 700,
    55  		Balance:     400,
    56  		SLoad:       200,
    57  		Calls:       700,
    58  		Suicide:     5000,
    59  		ExpByte:     10,
    60  
    61  		CreateBySuicide: 25000,
    62  	}
    63  
    64  	GasTableEIP158 = GasTable{
    65  		ExtcodeSize: 700,
    66  		ExtcodeCopy: 700,
    67  		Balance:     400,
    68  		SLoad:       200,
    69  		Calls:       700,
    70  		Suicide:     5000,
    71  		ExpByte:     50,
    72  
    73  		CreateBySuicide: 25000,
    74  	}
    75  )