diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-10 00:55:01 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-10 00:55:01 +0800 |
commit | 8560004f380dc688a1171ad5aeffa593aae41193 (patch) | |
tree | fea395acf042b51e97a86e2c4cbcf8c16b2912b7 /vm/address.go | |
parent | 9723191b19f6ddc12f0c3376ede7529b2d72e6a2 (diff) | |
parent | 676a0de58d3d7c508b0eeeff192d2095a46f7382 (diff) | |
download | dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.gz dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.bz2 dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.lz dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.xz dexon-8560004f380dc688a1171ad5aeffa593aae41193.tar.zst dexon-8560004f380dc688a1171ad5aeffa593aae41193.zip |
wip
Diffstat (limited to 'vm/address.go')
-rw-r--r-- | vm/address.go | 18 |
1 files changed, 9 insertions, 9 deletions
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}, } } |