aboutsummaryrefslogtreecommitdiffstats
path: root/vm/address.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-02 23:32:02 +0800
committerobscuren <geffobscura@gmail.com>2015-03-02 23:32:02 +0800
commitb383ff0b96a1cf3df0b56f13b8d303ae4d4977ad (patch)
tree6af5b54d74402e2c31ea083981d215c0701832f4 /vm/address.go
parent73c52d1677ba526385f1b223ef48f3a26091fe00 (diff)
downloaddexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.gz
dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.zst
dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.zip
New gas prices model
Diffstat (limited to 'vm/address.go')
-rw-r--r--vm/address.go18
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},
}
}