aboutsummaryrefslogtreecommitdiffstats
path: root/vm/address.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-16 23:50:29 +0800
committerzelig <viktor.tron@gmail.com>2015-03-16 23:50:29 +0800
commitb3e133dd159749a625c4b0245af293607ba12c8c (patch)
tree9ba8e8c4afe9168f5bc83219d402efb00387d616 /vm/address.go
parent8139d444f8d8163251d1c96ef8034d186825ce32 (diff)
parent73af0302bed5076260ac935e452064aee423934d (diff)
downloaddexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar.gz
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar.bz2
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar.lz
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar.xz
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.tar.zst
dexon-b3e133dd159749a625c4b0245af293607ba12c8c.zip
Merge branch 'frontier/js' into frontier/nodeadmin.js
Diffstat (limited to 'vm/address.go')
-rw-r--r--vm/address.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/vm/address.go b/vm/address.go
index b1345da8f..215f4bc8f 100644
--- a/vm/address.go
+++ b/vm/address.go
@@ -4,7 +4,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
)
type Address interface {
@@ -26,25 +26,25 @@ var Precompiled = PrecompiledContracts()
func PrecompiledContracts() map[string]*PrecompiledAccount {
return map[string]*PrecompiledAccount{
// ECRECOVER
- string(ethutil.LeftPadBytes([]byte{1}, 20)): &PrecompiledAccount{func(l int) *big.Int {
+ string(common.LeftPadBytes([]byte{1}, 20)): &PrecompiledAccount{func(l int) *big.Int {
return GasEcrecover
}, ecrecoverFunc},
// SHA256
- string(ethutil.LeftPadBytes([]byte{2}, 20)): &PrecompiledAccount{func(l int) *big.Int {
+ 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)
}, sha256Func},
// RIPEMD160
- string(ethutil.LeftPadBytes([]byte{3}, 20)): &PrecompiledAccount{func(l int) *big.Int {
+ 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)
}, ripemd160Func},
- string(ethutil.LeftPadBytes([]byte{4}, 20)): &PrecompiledAccount{func(l int) *big.Int {
+ string(common.LeftPadBytes([]byte{4}, 20)): &PrecompiledAccount{func(l int) *big.Int {
n := big.NewInt(int64(l+31) / 32)
n.Mul(n, GasIdentityWord)
@@ -58,7 +58,7 @@ func sha256Func(in []byte) []byte {
}
func ripemd160Func(in []byte) []byte {
- return ethutil.LeftPadBytes(crypto.Ripemd160(in), 32)
+ return common.LeftPadBytes(crypto.Ripemd160(in), 32)
}
func ecrecoverFunc(in []byte) []byte {
@@ -66,10 +66,10 @@ func ecrecoverFunc(in []byte) []byte {
defer func() { recover() }()
hash := in[:32]
- v := ethutil.BigD(in[32:64]).Bytes()[0] - 27
+ v := common.BigD(in[32:64]).Bytes()[0] - 27
sig := append(in[64:], v)
- return ethutil.LeftPadBytes(crypto.Sha3(crypto.Ecrecover(append(hash, sig...))[1:])[12:], 32)
+ return common.LeftPadBytes(crypto.Sha3(crypto.Ecrecover(append(hash, sig...))[1:])[12:], 32)
}
func memCpy(in []byte) []byte {