From b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 2 Mar 2015 16:32:02 +0100 Subject: New gas prices model --- vm/address.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vm/address.go') diff --git a/vm/address.go b/vm/address.go index 1c9369ab7..b1345da8f 100644 --- a/vm/address.go +++ b/vm/address.go @@ -32,23 +32,23 @@ func PrecompiledContracts() map[string]*PrecompiledAccount { // SHA256 string(ethutil.LeftPadBytes([]byte{2}, 20)): &PrecompiledAccount{func(l int) *big.Int { - n := big.NewInt(int64(l+31)/32 + 1) - n.Mul(n, GasSha256) - return n + n := big.NewInt(int64(l+31) / 32) + n.Mul(n, GasSha256Word) + return n.Add(n, GasSha256Base) }, sha256Func}, // RIPEMD160 string(ethutil.LeftPadBytes([]byte{3}, 20)): &PrecompiledAccount{func(l int) *big.Int { - n := big.NewInt(int64(l+31)/32 + 1) - n.Mul(n, GasRipemd) - return n + n := big.NewInt(int64(l+31) / 32) + n.Mul(n, GasRipemdWord) + return n.Add(n, GasRipemdBase) }, ripemd160Func}, string(ethutil.LeftPadBytes([]byte{4}, 20)): &PrecompiledAccount{func(l int) *big.Int { - n := big.NewInt(int64(l+31)/32 + 1) - n.Mul(n, GasMemCpy) + n := big.NewInt(int64(l+31) / 32) + n.Mul(n, GasIdentityWord) - return n + return n.Add(n, GasIdentityBase) }, memCpy}, } } -- cgit v1.2.3