Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ethtracer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nebula
ethtracer
Commits
fb8f3a91
Commit
fb8f3a91
authored
Jul 09, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update crypto
parent
a36c989e
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
297 additions
and
41 deletions
+297
-41
bloom9.go
evm/evmtypes/bloom9.go
+1
-1
hashes.go
evm/evmtypes/hashes.go
+1
-1
hashing.go
evm/evmtypes/hashing.go
+1
-1
receipt.go
evm/evmtypes/receipt.go
+3
-2
transaction.go
evm/evmtypes/transaction.go
+1
-1
transaction_signing.go
evm/evmtypes/transaction_signing.go
+1
-1
tx_blob.go
evm/evmtypes/tx_blob.go
+1
-1
tx_setcode.go
evm/evmtypes/tx_setcode.go
+1
-1
state_transition.go
evm/state_transition.go
+1
-1
analysis_legacy_test.go
evm/vm/analysis_legacy_test.go
+1
-1
contracts.go
evm/vm/contracts.go
+4
-4
evm.go
evm/vm/evm.go
+4
-3
instructions.go
evm/vm/instructions.go
+1
-1
interpreter.go
evm/vm/interpreter.go
+1
-1
runtime.go
evm/vm/runtime/runtime.go
+1
-1
go.mod
go.mod
+34
-4
go.sum
go.sum
+228
-6
goja.go
tracers/js/goja.go
+4
-3
prestate.go
tracers/native/prestate.go
+5
-4
statedb_hooked.go
tracers/statedb_hooked.go
+3
-3
No files found.
evm/evmtypes/bloom9.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
evmtypes
package
evmtypes
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"encoding/binary"
"encoding/binary"
"fmt"
"fmt"
"github.com/CaduceusMetaverseProtocol/MetaTypes/common/hexutil"
"github.com/CaduceusMetaverseProtocol/MetaTypes/common/hexutil"
...
...
evm/evmtypes/hashes.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
evmtypes
package
evmtypes
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
metatypes
"github.com/CaduceusMetaverseProtocol/MetaTypes/types"
metatypes
"github.com/CaduceusMetaverseProtocol/MetaTypes/types"
)
)
...
...
evm/evmtypes/hashing.go
View file @
fb8f3a91
...
@@ -18,7 +18,7 @@ package evmtypes
...
@@ -18,7 +18,7 @@ package evmtypes
import
(
import
(
"bytes"
"bytes"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"fmt"
"fmt"
metatypes
"github.com/CaduceusMetaverseProtocol/MetaTypes/types"
metatypes
"github.com/CaduceusMetaverseProtocol/MetaTypes/types"
...
...
evm/evmtypes/receipt.go
View file @
fb8f3a91
...
@@ -18,7 +18,8 @@ package evmtypes
...
@@ -18,7 +18,8 @@ package evmtypes
import
(
import
(
"bytes"
"bytes"
"code.wuban.net.cn/cmpchain/ethcrypto/crypto"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"errors"
"errors"
...
@@ -350,7 +351,7 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, hash metatypes.Hash,
...
@@ -350,7 +351,7 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, hash metatypes.Hash,
if
txs
[
i
]
.
To
()
==
nil
{
if
txs
[
i
]
.
To
()
==
nil
{
// Deriving the signer is expensive, only do if it's actually needed
// Deriving the signer is expensive, only do if it's actually needed
from
,
_
:=
Sender
(
signer
,
txs
[
i
])
from
,
_
:=
Sender
(
signer
,
txs
[
i
])
rs
[
i
]
.
ContractAddress
=
crypto
.
CreateAddress
(
from
,
txs
[
i
]
.
Nonce
())
rs
[
i
]
.
ContractAddress
=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress
(
common
.
BytesToAddress
(
from
.
Bytes
()),
txs
[
i
]
.
Nonce
())
.
Bytes
())
}
else
{
}
else
{
rs
[
i
]
.
ContractAddress
=
metatypes
.
Address
{}
rs
[
i
]
.
ContractAddress
=
metatypes
.
Address
{}
}
}
...
...
evm/evmtypes/transaction.go
View file @
fb8f3a91
...
@@ -18,7 +18,7 @@ package evmtypes
...
@@ -18,7 +18,7 @@ package evmtypes
import
(
import
(
"bytes"
"bytes"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"errors"
"errors"
"fmt"
"fmt"
...
...
evm/evmtypes/transaction_signing.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
evmtypes
package
evmtypes
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params/forks"
"code.wuban.net.cn/cmpchain/ethtracer/params/forks"
"crypto/ecdsa"
"crypto/ecdsa"
...
...
evm/evmtypes/tx_blob.go
View file @
fb8f3a91
...
@@ -18,7 +18,7 @@ package evmtypes
...
@@ -18,7 +18,7 @@ package evmtypes
import
(
import
(
"bytes"
"bytes"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto/kzg4844"
"
github.com/ethereum/go-ethereum
/crypto/kzg4844"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"crypto/sha256"
"crypto/sha256"
...
...
evm/evmtypes/tx_setcode.go
View file @
fb8f3a91
...
@@ -18,7 +18,7 @@ package evmtypes
...
@@ -18,7 +18,7 @@ package evmtypes
import
(
import
(
"bytes"
"bytes"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"code.wuban.net.cn/cmpchain/ethcrypto/rlp"
"crypto/ecdsa"
"crypto/ecdsa"
"errors"
"errors"
...
...
evm/state_transition.go
View file @
fb8f3a91
...
@@ -18,7 +18,7 @@ package evm
...
@@ -18,7 +18,7 @@ package evm
import
(
import
(
"bytes"
"bytes"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto/kzg4844"
"
github.com/ethereum/go-ethereum
/crypto/kzg4844"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
...
...
evm/vm/analysis_legacy_test.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
vm
package
vm
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"math/bits"
"math/bits"
"testing"
"testing"
)
)
...
...
evm/vm/contracts.go
View file @
fb8f3a91
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
package
vm
package
vm
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto/blake2b"
"
github.com/ethereum/go-ethereum
/crypto/blake2b"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto/bn256"
"
github.com/ethereum/go-ethereum
/crypto/bn256"
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto/kzg4844"
"
github.com/ethereum/go-ethereum
/crypto/kzg4844"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
"crypto/sha256"
"crypto/sha256"
...
...
evm/vm/evm.go
View file @
fb8f3a91
...
@@ -17,7 +17,8 @@
...
@@ -17,7 +17,8 @@
package
vm
package
vm
import
(
import
(
"code.wuban.net.cn/cmpchain/ethcrypto/crypto"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/state"
"code.wuban.net.cn/cmpchain/ethtracer/state"
...
@@ -547,7 +548,7 @@ func (evm *EVM) initNewContract(contract *Contract, address metatypes.Address) (
...
@@ -547,7 +548,7 @@ func (evm *EVM) initNewContract(contract *Contract, address metatypes.Address) (
// Create creates a new contract using code as deployment code.
// Create creates a new contract using code as deployment code.
func
(
evm
*
EVM
)
Create
(
caller
metatypes
.
Address
,
code
[]
byte
,
gas
uint64
,
value
*
uint256
.
Int
)
(
ret
[]
byte
,
contractAddr
metatypes
.
Address
,
leftOverGas
uint64
,
err
error
)
{
func
(
evm
*
EVM
)
Create
(
caller
metatypes
.
Address
,
code
[]
byte
,
gas
uint64
,
value
*
uint256
.
Int
)
(
ret
[]
byte
,
contractAddr
metatypes
.
Address
,
leftOverGas
uint64
,
err
error
)
{
contractAddr
=
crypto
.
CreateAddress
(
caller
,
evm
.
StateDB
.
GetNonce
(
caller
))
contractAddr
=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress
(
common
.
BytesToAddress
(
caller
.
Bytes
()),
evm
.
StateDB
.
GetNonce
(
caller
))
.
Bytes
(
))
return
evm
.
create
(
caller
,
code
,
gas
,
value
,
contractAddr
,
CREATE
)
return
evm
.
create
(
caller
,
code
,
gas
,
value
,
contractAddr
,
CREATE
)
}
}
...
@@ -556,7 +557,7 @@ func (evm *EVM) Create(caller metatypes.Address, code []byte, gas uint64, value
...
@@ -556,7 +557,7 @@ func (evm *EVM) Create(caller metatypes.Address, code []byte, gas uint64, value
// The different between Create2 with Create is Create2 uses keccak256(0xff ++ msg.sender ++ salt ++ keccak256(init_code))[12:]
// The different between Create2 with Create is Create2 uses keccak256(0xff ++ msg.sender ++ salt ++ keccak256(init_code))[12:]
// instead of the usual sender-and-nonce-hash as the address where the contract is initialized at.
// instead of the usual sender-and-nonce-hash as the address where the contract is initialized at.
func
(
evm
*
EVM
)
Create2
(
caller
metatypes
.
Address
,
code
[]
byte
,
gas
uint64
,
endowment
*
uint256
.
Int
,
salt
*
uint256
.
Int
)
(
ret
[]
byte
,
contractAddr
metatypes
.
Address
,
leftOverGas
uint64
,
err
error
)
{
func
(
evm
*
EVM
)
Create2
(
caller
metatypes
.
Address
,
code
[]
byte
,
gas
uint64
,
endowment
*
uint256
.
Int
,
salt
*
uint256
.
Int
)
(
ret
[]
byte
,
contractAddr
metatypes
.
Address
,
leftOverGas
uint64
,
err
error
)
{
contractAddr
=
crypto
.
CreateAddress2
(
caller
,
salt
.
Bytes32
(),
crypto
.
Keccak256
(
code
))
contractAddr
=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress2
(
common
.
BytesToAddress
(
caller
.
Bytes
()),
salt
.
Bytes32
(),
crypto
.
Keccak256
(
code
))
.
Bytes
(
))
return
evm
.
create
(
caller
,
code
,
gas
,
endowment
,
contractAddr
,
CREATE2
)
return
evm
.
create
(
caller
,
code
,
gas
,
endowment
,
contractAddr
,
CREATE2
)
}
}
...
...
evm/vm/instructions.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
vm
package
vm
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
...
...
evm/vm/interpreter.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
vm
package
vm
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
"code.wuban.net.cn/cmpchain/ethtracer/tracing"
"fmt"
"fmt"
"github.com/CaduceusMetaverseProtocol/MetaTypes/common/math"
"github.com/CaduceusMetaverseProtocol/MetaTypes/common/math"
...
...
evm/vm/runtime/runtime.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
runtime
package
runtime
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
...
...
go.mod
View file @
fb8f3a91
...
@@ -7,29 +7,59 @@ require (
...
@@ -7,29 +7,59 @@ require (
github.com/CaduceusMetaverseProtocol/MetaTypes v1.0.0
github.com/CaduceusMetaverseProtocol/MetaTypes v1.0.0
github.com/consensys/gnark-crypto v0.18.0
github.com/consensys/gnark-crypto v0.18.0
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a
github.com/dop251/goja v0.0.0-20250630131328-58d95d85e994
github.com/ethereum/go-ethereum v1.16.1
github.com/ethereum/go-verkle v0.2.2
github.com/ethereum/go-verkle v0.2.2
github.com/holiman/uint256 v1.3.2
github.com/holiman/uint256 v1.3.2
github.com/sirupsen/logrus v1.9.3
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.10.0
golang.org/x/crypto v0.36.0
golang.org/x/crypto v0.36.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)
)
require (
require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dop251/goja v0.0.0-20250630131328-58d95d85e994 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 // indirect
github.com/ferranbt/fastssz v0.1.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pion/dtls/v2 v2.2.7 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/stun/v2 v2.0.0 // indirect
github.com/pion/transport/v2 v2.2.1 // indirect
github.com/pion/transport/v3 v3.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/text v0.23.0 // indirect
gopkg.in/
natefinch/lumberjack.v2 v2.2.1
// indirect
gopkg.in/
yaml.v2 v2.4.0
// indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
...
...
go.sum
View file @
fb8f3a91
This diff is collapsed.
Click to expand it.
tracers/js/goja.go
View file @
fb8f3a91
...
@@ -17,7 +17,8 @@
...
@@ -17,7 +17,8 @@
package
js
package
js
import
(
import
(
"code.wuban.net.cn/cmpchain/ethcrypto/crypto"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/tracers"
"code.wuban.net.cn/cmpchain/ethtracer/tracers"
...
@@ -513,7 +514,7 @@ func (t *jsTracer) setBuiltinFunctions() {
...
@@ -513,7 +514,7 @@ func (t *jsTracer) setBuiltinFunctions() {
vm
.
Interrupt
(
err
)
vm
.
Interrupt
(
err
)
return
nil
return
nil
}
}
addr
:=
metatypes
.
BytesToAddress
(
a
)
addr
:=
common
.
BytesToAddress
(
a
)
b
:=
crypto
.
CreateAddress
(
addr
,
uint64
(
nonce
))
.
Bytes
()
b
:=
crypto
.
CreateAddress
(
addr
,
uint64
(
nonce
))
.
Bytes
()
res
,
err
:=
t
.
toBuf
(
vm
,
b
)
res
,
err
:=
t
.
toBuf
(
vm
,
b
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -528,7 +529,7 @@ func (t *jsTracer) setBuiltinFunctions() {
...
@@ -528,7 +529,7 @@ func (t *jsTracer) setBuiltinFunctions() {
vm
.
Interrupt
(
err
)
vm
.
Interrupt
(
err
)
return
nil
return
nil
}
}
addr
:=
metatypes
.
BytesToAddress
(
a
)
addr
:=
common
.
BytesToAddress
(
a
)
code
,
err
:=
t
.
fromBuf
(
vm
,
initcode
,
true
)
code
,
err
:=
t
.
fromBuf
(
vm
,
initcode
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
vm
.
Interrupt
(
err
)
vm
.
Interrupt
(
err
)
...
...
tracers/native/prestate.go
View file @
fb8f3a91
...
@@ -18,7 +18,8 @@ package native
...
@@ -18,7 +18,8 @@ package native
import
(
import
(
"bytes"
"bytes"
"code.wuban.net.cn/cmpchain/ethcrypto/crypto"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
...
@@ -127,7 +128,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
...
@@ -127,7 +128,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
t
.
lookupAccount
(
addr
)
t
.
lookupAccount
(
addr
)
case
op
==
vm
.
CREATE
:
case
op
==
vm
.
CREATE
:
nonce
:=
t
.
env
.
StateDB
.
GetNonce
(
caller
)
nonce
:=
t
.
env
.
StateDB
.
GetNonce
(
caller
)
addr
:=
crypto
.
CreateAddress
(
caller
,
nonce
)
addr
:=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress
(
common
.
BytesToAddress
(
caller
.
Bytes
()),
nonce
)
.
Bytes
()
)
t
.
lookupAccount
(
addr
)
t
.
lookupAccount
(
addr
)
t
.
created
[
addr
]
=
true
t
.
created
[
addr
]
=
true
case
stackLen
>=
4
&&
op
==
vm
.
CREATE2
:
case
stackLen
>=
4
&&
op
==
vm
.
CREATE2
:
...
@@ -140,7 +141,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
...
@@ -140,7 +141,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
}
}
inithash
:=
crypto
.
Keccak256
(
init
)
inithash
:=
crypto
.
Keccak256
(
init
)
salt
:=
stackData
[
stackLen
-
4
]
salt
:=
stackData
[
stackLen
-
4
]
addr
:=
crypto
.
CreateAddress2
(
caller
,
salt
.
Bytes32
(),
inithash
)
addr
:=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress2
(
common
.
BytesToAddress
(
caller
.
Bytes
()),
salt
.
Bytes32
(),
inithash
)
.
Bytes
()
)
t
.
lookupAccount
(
addr
)
t
.
lookupAccount
(
addr
)
t
.
created
[
addr
]
=
true
t
.
created
[
addr
]
=
true
}
}
...
@@ -149,7 +150,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
...
@@ -149,7 +150,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop
func
(
t
*
prestateTracer
)
OnTxStart
(
env
*
tracing
.
VMContext
,
tx
*
evmtypes
.
Transaction
,
from
metatypes
.
Address
)
{
func
(
t
*
prestateTracer
)
OnTxStart
(
env
*
tracing
.
VMContext
,
tx
*
evmtypes
.
Transaction
,
from
metatypes
.
Address
)
{
t
.
env
=
env
t
.
env
=
env
if
tx
.
To
()
==
nil
{
if
tx
.
To
()
==
nil
{
t
.
to
=
crypto
.
CreateAddress
(
from
,
env
.
StateDB
.
GetNonce
(
from
))
t
.
to
=
metatypes
.
BytesToAddress
(
crypto
.
CreateAddress
(
common
.
BytesToAddress
(
from
.
Bytes
()),
env
.
StateDB
.
GetNonce
(
from
))
.
Bytes
(
))
t
.
created
[
t
.
to
]
=
true
t
.
created
[
t
.
to
]
=
true
}
else
{
}
else
{
t
.
to
=
*
tx
.
To
()
t
.
to
=
*
tx
.
To
()
...
...
tracers/statedb_hooked.go
View file @
fb8f3a91
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
package
tracers
package
tracers
import
(
import
(
"
code.wuban.net.cn/cmpchain/ethcrypto
/crypto"
"
github.com/ethereum/go-ethereum
/crypto"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/evmtypes"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/evm/vm"
"code.wuban.net.cn/cmpchain/ethtracer/params"
"code.wuban.net.cn/cmpchain/ethtracer/params"
...
@@ -209,9 +209,9 @@ func (s *hookedStateDB) SetCode(address metatypes.Address, code []byte) []byte {
...
@@ -209,9 +209,9 @@ func (s *hookedStateDB) SetCode(address metatypes.Address, code []byte) []byte {
if
s
.
hooks
.
OnCodeChange
!=
nil
{
if
s
.
hooks
.
OnCodeChange
!=
nil
{
prevHash
:=
types
.
EmptyCodeHash
prevHash
:=
types
.
EmptyCodeHash
if
len
(
prev
)
!=
0
{
if
len
(
prev
)
!=
0
{
prevHash
=
crypto
.
Keccak256Hash
(
prev
)
prevHash
=
metatypes
.
BytesToHash
(
crypto
.
Keccak256Hash
(
prev
)
.
Bytes
()
)
}
}
s
.
hooks
.
OnCodeChange
(
address
,
prevHash
,
prev
,
crypto
.
Keccak256Hash
(
code
),
code
)
s
.
hooks
.
OnCodeChange
(
address
,
prevHash
,
prev
,
metatypes
.
BytesToHash
(
crypto
.
Keccak256Hash
(
code
)
.
Bytes
()
),
code
)
}
}
return
prev
return
prev
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment