aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/address.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/address.go')
-rw-r--r--core/vm/address.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/vm/address.go b/core/vm/address.go
index 0b3a95dd0..df801863f 100644
--- a/core/vm/address.go
+++ b/core/vm/address.go
@@ -5,6 +5,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/params"
)
type Address interface {
@@ -27,28 +28,28 @@ func PrecompiledContracts() map[string]*PrecompiledAccount {
return map[string]*PrecompiledAccount{
// ECRECOVER
string(common.LeftPadBytes([]byte{1}, 20)): &PrecompiledAccount{func(l int) *big.Int {
- return GasEcrecover
+ return params.EcrecoverGas
}, ecrecoverFunc},
// SHA256
string(common.LeftPadBytes([]byte{2}, 20)): &PrecompiledAccount{func(l int) *big.Int {
n := big.NewInt(int64(l+31) / 32)
- n.Mul(n, GasSha256Word)
- return n.Add(n, GasSha256Base)
+ n.Mul(n, params.Sha256WordGas)
+ return n.Add(n, params.Sha256Gas)
}, sha256Func},
// RIPEMD160
string(common.LeftPadBytes([]byte{3}, 20)): &PrecompiledAccount{func(l int) *big.Int {
n := big.NewInt(int64(l+31) / 32)
- n.Mul(n, GasRipemdWord)
- return n.Add(n, GasRipemdBase)
+ n.Mul(n, params.Ripemd160WordGas)
+ return n.Add(n, params.Ripemd160Gas)
}, ripemd160Func},
string(common.LeftPadBytes([]byte{4}, 20)): &PrecompiledAccount{func(l int) *big.Int {
n := big.NewInt(int64(l+31) / 32)
- n.Mul(n, GasIdentityWord)
+ n.Mul(n, params.IdentityWordGas)
- return n.Add(n, GasIdentityBase)
+ return n.Add(n, params.IdentityGas)
}, memCpy},
}
}