gas_table.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. package params
  17. type GasTable struct {
  18. ExtcodeSize uint64
  19. ExtcodeCopy uint64
  20. Balance uint64
  21. SLoad uint64
  22. Calls uint64
  23. Suicide uint64
  24. ExpByte uint64
  25. // CreateBySuicide occurs when the
  26. // refunded account is one that does
  27. // not exist. This logic is similar
  28. // to call. May be left nil. Nil means
  29. // not charged.
  30. CreateBySuicide uint64
  31. }
  32. var (
  33. // GasTableHomestead contain the gas prices for
  34. // the homestead phase.
  35. GasTableHomestead = GasTable{
  36. ExtcodeSize: 20,
  37. ExtcodeCopy: 20,
  38. Balance: 20,
  39. SLoad: 50,
  40. Calls: 40,
  41. Suicide: 0,
  42. ExpByte: 10,
  43. }
  44. // GasTableHomestead contain the gas re-prices for
  45. // the homestead phase.
  46. GasTableEIP150 = GasTable{
  47. ExtcodeSize: 700,
  48. ExtcodeCopy: 700,
  49. Balance: 400,
  50. SLoad: 200,
  51. Calls: 700,
  52. Suicide: 5000,
  53. ExpByte: 10,
  54. CreateBySuicide: 25000,
  55. }
  56. GasTableEIP158 = GasTable{
  57. ExtcodeSize: 700,
  58. ExtcodeCopy: 700,
  59. Balance: 400,
  60. SLoad: 200,
  61. Calls: 700,
  62. Suicide: 5000,
  63. ExpByte: 50,
  64. CreateBySuicide: 25000,
  65. }
  66. )