Documentation ¶
Overview ¶
Copyright 2014 The go-ethereum Authors This file is part of the go-ethereum library.
The go-ethereum library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The go-ethereum library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
const ( GasEcrecover uint64 = 3000 GasSha256Base uint64 = 60 // Base price for a SHA256 operation GasSha256PerWord uint64 = 12 // Per-word price for a SHA256 operation )
Here defines some gas usage
Variables ¶
This section is empty.
Functions ¶
func IsPrecompile ¶
IsPrecompile return if an address is precompile contract
Types ¶
type Contract ¶
type Contract interface { RequiredGas(input []byte) uint64 // RequiredPrice calculates the contract gas use Run(input []byte) ([]byte, error) // Run runs the precompiled contract }
Contract is the basic interface for native Go contracts. The implementation requires a deterministic gas count based on the input size of the Run method of the contract.