github.com/ylsGit/go-ethereum@v1.6.5/params/gas_table.go (about)

     1  // Copyright 2016 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum 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 go-ethereum 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 go-ethereum 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  	//
    53  	// TODO rename to GasTableEIP150
    54  	GasTableHomesteadGasRepriceFork = GasTable{
    55  		ExtcodeSize: 700,
    56  		ExtcodeCopy: 700,
    57  		Balance:     400,
    58  		SLoad:       200,
    59  		Calls:       700,
    60  		Suicide:     5000,
    61  		ExpByte:     10,
    62  
    63  		CreateBySuicide: 25000,
    64  	}
    65  
    66  	GasTableEIP158 = GasTable{
    67  		ExtcodeSize: 700,
    68  		ExtcodeCopy: 700,
    69  		Balance:     400,
    70  		SLoad:       200,
    71  		Calls:       700,
    72  		Suicide:     5000,
    73  		ExpByte:     50,
    74  
    75  		CreateBySuicide: 25000,
    76  	}
    77  )