mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Merge pull request #42 from ShyftNetwork/dynamic/internalTxs-test
Dynamic/internal txs
This commit is contained in:
commit
26e924958f
28 changed files with 1680 additions and 804 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -51,3 +51,4 @@ $HOME
|
||||||
shyftData/*
|
shyftData/*
|
||||||
shyft-cli/web3/token_test/node_modules
|
shyft-cli/web3/token_test/node_modules
|
||||||
shyft-cli/web3/transfer-through-master/node_modules
|
shyft-cli/web3/transfer-through-master/node_modules
|
||||||
|
shyft-cli/web3/transfer-through-master/build
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import (
|
||||||
const (
|
const (
|
||||||
testInstance = "console-tester"
|
testInstance = "console-tester"
|
||||||
testAddress = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
testAddress = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
||||||
)
|
)
|
||||||
|
|
||||||
// hookedPrompter implements UserPrompter to simulate use input via channels.
|
// hookedPrompter implements UserPrompter to simulate use input via channels.
|
||||||
type hookedPrompter struct {
|
type hookedPrompter struct {
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/mclock"
|
"github.com/ethereum/go-ethereum/common/mclock"
|
||||||
"github.com/ethereum/go-ethereum/consensus"
|
"github.com/ethereum/go-ethereum/consensus"
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
"github.com/ethereum/go-ethereum/shyftdb"
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
|
@ -901,15 +901,13 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
|
||||||
if err := WriteBlock(batch, block); err != nil {
|
if err := WriteBlock(batch, block); err != nil {
|
||||||
return NonStatTy, err
|
return NonStatTy, err
|
||||||
}
|
}
|
||||||
// @NOTE:SHYFT - Write block data for block explorer
|
|
||||||
if err := shyftdb.WriteBlock(block, receipts); err != nil {
|
|
||||||
return NonStatTy, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root, err := state.Commit(bc.chainConfig.IsEIP158(block.Number()))
|
root, err := state.Commit(bc.chainConfig.IsEIP158(block.Number()))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return NonStatTy, err
|
return NonStatTy, err
|
||||||
}
|
}
|
||||||
|
|
||||||
triedb := bc.stateCache.TrieDB()
|
triedb := bc.stateCache.TrieDB()
|
||||||
|
|
||||||
// If we're running an archive node, always flush
|
// If we're running an archive node, always flush
|
||||||
|
|
@ -1001,6 +999,12 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
|
||||||
if status == CanonStatTy {
|
if status == CanonStatTy {
|
||||||
bc.insert(block)
|
bc.insert(block)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE:SHYFT - Write block data for block explorer
|
||||||
|
//fmt.Printf("\n\t[BLOCKCHAIN.GO bc.chainConfig] %+v", bc.chainConfig)
|
||||||
|
if err := SWriteBlock(block, receipts); err != nil {
|
||||||
|
return NonStatTy, err
|
||||||
|
}
|
||||||
bc.futureBlocks.Remove(block.Hash())
|
bc.futureBlocks.Remove(block.Hash())
|
||||||
return status, nil
|
return status, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,13 @@ func GetTxLookupEntry(db DatabaseReader, hash common.Hash) (common.Hash, uint64,
|
||||||
// its added positional metadata.
|
// its added positional metadata.
|
||||||
func GetTransaction(db DatabaseReader, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64) {
|
func GetTransaction(db DatabaseReader, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64) {
|
||||||
// Retrieve the lookup metadata and resolve the transaction from the body
|
// Retrieve the lookup metadata and resolve the transaction from the body
|
||||||
|
//fmt.Println("INSIDE GET TRANSACTION ++++++++")
|
||||||
|
//fmt.Println("The hash and db reader are")
|
||||||
|
//fmt.Println(hash)
|
||||||
|
//fmt.Println(db)
|
||||||
blockHash, blockNumber, txIndex := GetTxLookupEntry(db, hash)
|
blockHash, blockNumber, txIndex := GetTxLookupEntry(db, hash)
|
||||||
|
//fmt.Println(blockHash)
|
||||||
|
//fmt.Println(blockNumber)
|
||||||
|
|
||||||
if blockHash != (common.Hash{}) {
|
if blockHash != (common.Hash{}) {
|
||||||
body := GetBody(db, blockHash, blockNumber)
|
body := GetBody(db, blockHash, blockNumber)
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,34 @@
|
||||||
package shyftdb
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var blockExplorerDb *sql.DB
|
var blockExplorerDb *sql.DB
|
||||||
|
|
||||||
|
const (
|
||||||
|
connStr = "user=postgres dbname=shyftdb sslmode=disable"
|
||||||
|
connStrTest = "user=postgres dbname=shyftdbtest sslmode=disable"
|
||||||
|
)
|
||||||
|
|
||||||
func InitDB() (*sql.DB, error){
|
func InitDB() (*sql.DB, error){
|
||||||
var connStr string
|
|
||||||
if "test" == os.Getenv("SHYFT_ENV") {
|
|
||||||
connStr = "user=postgres dbname=shyftdbtest sslmode=disable"
|
|
||||||
} else {
|
|
||||||
connStr = "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
}
|
|
||||||
db, err := sql.Open("postgres", connStr)
|
db, err := sql.Open("postgres", connStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("ERROR OPENING DB, NOT INITIALIZING")
|
fmt.Println("ERROR OPENING DB, NOT INITIALIZING")
|
||||||
fmt.Println(err)
|
panic(err)
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
blockExplorerDb = db
|
||||||
|
return blockExplorerDb, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func InitDBTest() (*sql.DB, error){
|
||||||
|
db, err := sql.Open("postgres", connStrTest)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("ERROR OPENING DB, NOT INITIALIZING")
|
||||||
|
panic(err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
blockExplorerDb = db
|
blockExplorerDb = db
|
||||||
|
|
@ -35,7 +35,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ethereum/go-ethereum/shyftdb"
|
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -145,7 +144,7 @@ func (e *GenesisMismatchError) Error() string {
|
||||||
//@NOTE:SHYFT
|
//@NOTE:SHYFT
|
||||||
func WriteShyftGen(gen *Genesis, block *types.Block) {
|
func WriteShyftGen(gen *Genesis, block *types.Block) {
|
||||||
|
|
||||||
sqldb, _ := shyftdb.DBConnection()
|
sqldb, _ := DBConnection()
|
||||||
|
|
||||||
for k := range gen.Alloc {
|
for k := range gen.Alloc {
|
||||||
addr := k.String()
|
addr := k.String()
|
||||||
|
|
@ -187,15 +186,13 @@ func WriteShyftGen(gen *Genesis, block *types.Block) {
|
||||||
panic(insertError)
|
panic(insertError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.Info("Found Genesis Block")
|
log.Info("Found Genesis Block")
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
func WriteShyftBlockZero(block *types.Block, gen *Genesis) error {
|
func WriteShyftBlockZero(block *types.Block, gen *Genesis) error {
|
||||||
|
|
||||||
sqldb, _ := shyftdb.DBConnection()
|
sqldb, _ := DBConnection()
|
||||||
|
|
||||||
coinbase := block.Header().Coinbase.String()
|
coinbase := block.Header().Coinbase.String()
|
||||||
number := block.Header().Number.String()
|
number := block.Header().Number.String()
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,27 @@
|
||||||
package shyftdb
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"time"
|
||||||
|
"strconv"
|
||||||
|
"database/sql"
|
||||||
|
"log"
|
||||||
|
_ "github.com/lib/pq"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"time"
|
|
||||||
"strconv"
|
|
||||||
"database/sql"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
_ "github.com/lib/pq"
|
|
||||||
Rewards "github.com/ethereum/go-ethereum/consensus/ethash"
|
Rewards "github.com/ethereum/go-ethereum/consensus/ethash"
|
||||||
|
"github.com/ethereum/go-ethereum/shyfttracerinterface"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var IShyftTracer shyfttracerinterface.IShyftTracer
|
||||||
|
|
||||||
|
func SetIShyftTracer(st shyfttracerinterface.IShyftTracer) {
|
||||||
|
IShyftTracer = st
|
||||||
|
}
|
||||||
|
|
||||||
//SBlock type
|
//SBlock type
|
||||||
type SBlock struct {
|
type SBlock struct {
|
||||||
Hash string
|
Hash string
|
||||||
|
|
@ -104,14 +111,14 @@ type SendAndReceive struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
//WriteBlock writes to block info to sql db
|
//WriteBlock writes to block info to sql db
|
||||||
func WriteBlock(block *types.Block, receipts []*types.Receipt) error {
|
func SWriteBlock(block *types.Block, receipts []*types.Receipt) error {
|
||||||
|
|
||||||
sqldb, err := DBConnection()
|
sqldb, err := DBConnection()
|
||||||
if (err != nil) {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
rewards := writeMinerRewards(sqldb,block)
|
rewards := swriteMinerRewards(sqldb,block)
|
||||||
coinbase := block.Header().Coinbase.String()
|
coinbase := block.Header().Coinbase.String()
|
||||||
number := block.Header().Number.String()
|
number := block.Header().Number.String()
|
||||||
gasUsed := block.Header().GasUsed
|
gasUsed := block.Header().GasUsed
|
||||||
|
|
@ -138,12 +145,12 @@ func WriteBlock(block *types.Block, receipts []*types.Receipt) error {
|
||||||
|
|
||||||
if block.Transactions().Len() > 0 {
|
if block.Transactions().Len() > 0 {
|
||||||
for _, tx := range block.Transactions() {
|
for _, tx := range block.Transactions() {
|
||||||
writeTransactions(sqldb, tx, block.Header().Hash(), block.Header().Number.String(), receipts, age, gasLimit)
|
SwriteTransactions(sqldb, tx, block.Header().Hash(), block.Header().Number.String(), receipts, age, gasLimit)
|
||||||
if block.Transactions()[0].To() != nil {
|
if block.Transactions()[0].To() != nil {
|
||||||
writeFromBalance(sqldb, tx)
|
swriteFromBalance(sqldb, tx)
|
||||||
}
|
}
|
||||||
if block.Transactions()[0].To() == nil {
|
if block.Transactions()[0].To() == nil {
|
||||||
writeContractBalance(sqldb, tx)
|
swriteContractBalance(sqldb, tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +158,7 @@ func WriteBlock(block *types.Block, receipts []*types.Receipt) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
//writeTransactions writes to sqldb
|
//writeTransactions writes to sqldb
|
||||||
func writeTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Hash, blockNumber string, receipts []*types.Receipt, age time.Time, gasLimit uint64) error {
|
func SwriteTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Hash, blockNumber string, receipts []*types.Receipt, age time.Time, gasLimit uint64) error {
|
||||||
txData := ShyftTxEntry{
|
txData := ShyftTxEntry{
|
||||||
TxHash: tx.Hash(),
|
TxHash: tx.Hash(),
|
||||||
From: tx.From(),
|
From: tx.From(),
|
||||||
|
|
@ -164,7 +171,10 @@ func writeTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Ha
|
||||||
Nonce: tx.Nonce(),
|
Nonce: tx.Nonce(),
|
||||||
Data: tx.Data(),
|
Data: tx.Data(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hash := txData.TxHash
|
||||||
txHash := txData.TxHash.Hex()
|
txHash := txData.TxHash.Hex()
|
||||||
|
|
||||||
from := txData.From.Hex()
|
from := txData.From.Hex()
|
||||||
blockHasher := txData.BlockHash
|
blockHasher := txData.BlockHash
|
||||||
amount := txData.Amount.String()
|
amount := txData.Amount.String()
|
||||||
|
|
@ -194,7 +204,6 @@ func writeTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Ha
|
||||||
isContract = true
|
isContract = true
|
||||||
sqlStatement := `INSERT INTO txs(txhash, from_addr, to_addr, blockhash, blockNumber, amount, gasprice, gas, gasLimit,txfee, nonce, isContract, txStatus, age, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10), ($11), ($12), ($13), ($14), ($15)) RETURNING nonce`
|
sqlStatement := `INSERT INTO txs(txhash, from_addr, to_addr, blockhash, blockNumber, amount, gasprice, gas, gasLimit,txfee, nonce, isContract, txStatus, age, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10), ($11), ($12), ($13), ($14), ($15)) RETURNING nonce`
|
||||||
qerr := sqldb.QueryRow(sqlStatement, txHash, from, contractAddressFromReciept, blockHasher, blockNumber, amount, gasPrice, gas, gasLimit, txFee, nonce, isContract, statusFromReciept, age,data).Scan(&retNonce)
|
qerr := sqldb.QueryRow(sqlStatement, txHash, from, contractAddressFromReciept, blockHasher, blockNumber, amount, gasPrice, gas, gasLimit, txFee, nonce, isContract, statusFromReciept, age,data).Scan(&retNonce)
|
||||||
|
|
||||||
if qerr != nil {
|
if qerr != nil {
|
||||||
panic(qerr)
|
panic(qerr)
|
||||||
}
|
}
|
||||||
|
|
@ -218,11 +227,12 @@ func writeTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Ha
|
||||||
panic(qerr)
|
panic(qerr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IShyftTracer.GetTracerToRun(hash)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeContractBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
func swriteContractBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
||||||
sendAndReceiveData := SendAndReceive{
|
sendAndReceiveData := SendAndReceive{
|
||||||
From: tx.From().Hex(),
|
From: tx.From().Hex(),
|
||||||
Amount: tx.Value().String(),
|
Amount: tx.Value().String(),
|
||||||
|
|
@ -243,7 +253,7 @@ func writeContractBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
||||||
panic(insertErr)
|
panic(insertErr)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
getAccountBalanceSender:= GetAccount(sqldb, fromAddr)
|
getAccountBalanceSender:= SGetAccount(sqldb, fromAddr)
|
||||||
var senderBalance SendAndReceive
|
var senderBalance SendAndReceive
|
||||||
if err := json.Unmarshal([]byte(getAccountBalanceSender), &senderBalance); err != nil {
|
if err := json.Unmarshal([]byte(getAccountBalanceSender), &senderBalance); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
@ -274,9 +284,28 @@ func writeContractBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func swriteContractBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, string, string) {
|
||||||
|
sendAndReceiveData := SendAndReceive{
|
||||||
|
From: tx.From().Hex(),
|
||||||
|
Amount: tx.Value().String(),
|
||||||
|
}
|
||||||
|
|
||||||
|
fromAddr := sendAndReceiveData.From
|
||||||
|
getAccountBalanceSender:= SGetAccount(sqldb, fromAddr)
|
||||||
|
|
||||||
|
var senderBalance SendAndReceive
|
||||||
|
if err := json.Unmarshal([]byte(getAccountBalanceSender), &senderBalance); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
balanceSender := senderBalance.Balance
|
||||||
|
accountNonceSender := senderBalance.TxCountAccount
|
||||||
|
|
||||||
|
return sendAndReceiveData, balanceSender, accountNonceSender
|
||||||
|
}
|
||||||
|
|
||||||
//writeFromBalance writes senders balance to accounts db
|
//writeFromBalance writes senders balance to accounts db
|
||||||
func writeFromBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
func swriteFromBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
||||||
sendAndReceiveData, balanceRec, balanceSen, accountNonceRec, accountNonceSen := writeBalanceHelper(sqldb, tx)
|
sendAndReceiveData, balanceRec, balanceSen, accountNonceRec, accountNonceSen := swriteBalanceHelper(sqldb, tx)
|
||||||
toAddr := sendAndReceiveData.To
|
toAddr := sendAndReceiveData.To
|
||||||
fromAddr := sendAndReceiveData.From
|
fromAddr := sendAndReceiveData.From
|
||||||
amount := sendAndReceiveData.Amount
|
amount := sendAndReceiveData.Amount
|
||||||
|
|
@ -348,7 +377,7 @@ func writeFromBalance(sqldb *sql.DB, tx *types.Transaction) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, string, string, string, string) {
|
func swriteBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, string, string, string, string) {
|
||||||
sendAndReceiveData := SendAndReceive{
|
sendAndReceiveData := SendAndReceive{
|
||||||
To: tx.To().Hex(),
|
To: tx.To().Hex(),
|
||||||
From: tx.From().Hex(),
|
From: tx.From().Hex(),
|
||||||
|
|
@ -357,8 +386,9 @@ func writeBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, s
|
||||||
|
|
||||||
toAddr := sendAndReceiveData.To
|
toAddr := sendAndReceiveData.To
|
||||||
fromAddr := sendAndReceiveData.From
|
fromAddr := sendAndReceiveData.From
|
||||||
getAccountBalanceReceiver := GetAccount(sqldb, toAddr)
|
|
||||||
getAccountBalanceSender:= GetAccount(sqldb, fromAddr)
|
getAccountBalanceReceiver := SGetAccount(sqldb, toAddr)
|
||||||
|
getAccountBalanceSender:= SGetAccount(sqldb, fromAddr)
|
||||||
|
|
||||||
var receiverBalance SendAndReceive
|
var receiverBalance SendAndReceive
|
||||||
if err := json.Unmarshal([]byte(getAccountBalanceReceiver), &receiverBalance); err != nil {
|
if err := json.Unmarshal([]byte(getAccountBalanceReceiver), &receiverBalance); err != nil {
|
||||||
|
|
@ -382,7 +412,7 @@ func writeBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, s
|
||||||
// uncle blocks, account balance updates based on reorgs, diverges that get dropped.
|
// uncle blocks, account balance updates based on reorgs, diverges that get dropped.
|
||||||
// Reason for this is because the accounts are not deterministic like the block and tx hashes.
|
// Reason for this is because the accounts are not deterministic like the block and tx hashes.
|
||||||
// @TODO: Calculate reorg
|
// @TODO: Calculate reorg
|
||||||
func writeMinerRewards(sqldb *sql.DB, block *types.Block) string {
|
func swriteMinerRewards(sqldb *sql.DB, block *types.Block) string {
|
||||||
minerAddr := block.Coinbase().String()
|
minerAddr := block.Coinbase().String()
|
||||||
shyftConduitAddress := Rewards.ShyftNetworkConduitAddress.String()
|
shyftConduitAddress := Rewards.ShyftNetworkConduitAddress.String()
|
||||||
// Calculate the total gas used in the block
|
// Calculate the total gas used in the block
|
||||||
|
|
@ -412,13 +442,13 @@ func writeMinerRewards(sqldb *sql.DB, block *types.Block) string {
|
||||||
uncleAddrs = append(uncleAddrs, uncle.Coinbase.String())
|
uncleAddrs = append(uncleAddrs, uncle.Coinbase.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
storeReward(sqldb, minerAddr, totalMinerReward)
|
sstoreReward(sqldb, minerAddr, totalMinerReward)
|
||||||
storeReward(sqldb, shyftConduitAddress, Rewards.ShyftNetworkBlockReward)
|
sstoreReward(sqldb, shyftConduitAddress, Rewards.ShyftNetworkBlockReward)
|
||||||
var uncRewards = new(big.Int)
|
var uncRewards = new(big.Int)
|
||||||
for i := 0; i < len(uncleAddrs); i++ {
|
for i := 0; i < len(uncleAddrs); i++ {
|
||||||
uncRewards := uncleRewards[i]
|
uncRewards := uncleRewards[i]
|
||||||
fmt.Println(uncRewards)
|
fmt.Println(uncRewards)
|
||||||
storeReward(sqldb, uncleAddrs[i], uncleRewards[i])
|
sstoreReward(sqldb, uncleAddrs[i], uncleRewards[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
fullRewardValue := new(big.Int)
|
fullRewardValue := new(big.Int)
|
||||||
|
|
@ -428,7 +458,7 @@ func writeMinerRewards(sqldb *sql.DB, block *types.Block) string {
|
||||||
return fullRewardValue.String()
|
return fullRewardValue.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func storeReward(sqldb *sql.DB, address string, reward *big.Int) {
|
func sstoreReward(sqldb *sql.DB, address string, reward *big.Int) {
|
||||||
// Check if address exists
|
// Check if address exists
|
||||||
var addressBalance string
|
var addressBalance string
|
||||||
addressExistsStatement := `SELECT balance from accounts WHERE addr = ($1)`
|
addressExistsStatement := `SELECT balance from accounts WHERE addr = ($1)`
|
||||||
|
|
@ -477,7 +507,7 @@ func storeReward(sqldb *sql.DB, address string, reward *big.Int) {
|
||||||
//Look into postgres functions array_to_json(array_agg(lap))
|
//Look into postgres functions array_to_json(array_agg(lap))
|
||||||
//Example select array_to_json(array_agg(lap))
|
//Example select array_to_json(array_agg(lap))
|
||||||
//from ( select * from blocks)lap;
|
//from ( select * from blocks)lap;
|
||||||
func GetAllBlocks(sqldb *sql.DB) string {
|
func SGetAllBlocks(sqldb *sql.DB) string {
|
||||||
var arr blockRes
|
var arr blockRes
|
||||||
var blockArr string
|
var blockArr string
|
||||||
rows, err := sqldb.Query(`
|
rows, err := sqldb.Query(`
|
||||||
|
|
@ -545,7 +575,7 @@ func GetAllBlocks(sqldb *sql.DB) string {
|
||||||
|
|
||||||
//GetBlock queries to send single block info
|
//GetBlock queries to send single block info
|
||||||
//TODO provide blockHash arg passed from handler.go
|
//TODO provide blockHash arg passed from handler.go
|
||||||
func GetBlock(sqldb *sql.DB, blockNumber string) string {
|
func SGetBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
sqlStatement := `SELECT * FROM blocks WHERE number=$1;`
|
sqlStatement := `SELECT * FROM blocks WHERE number=$1;`
|
||||||
row := sqldb.QueryRow(sqlStatement, blockNumber)
|
row := sqldb.QueryRow(sqlStatement, blockNumber)
|
||||||
var hash string
|
var hash string
|
||||||
|
|
@ -598,7 +628,7 @@ func GetBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
return string(json)
|
return string(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRecentBlock(sqldb *sql.DB) string {
|
func SGetRecentBlock(sqldb *sql.DB) string {
|
||||||
sqlStatement := `SELECT * FROM blocks WHERE number=(SELECT MAX(number) FROM blocks);`
|
sqlStatement := `SELECT * FROM blocks WHERE number=(SELECT MAX(number) FROM blocks);`
|
||||||
row := sqldb.QueryRow(sqlStatement)
|
row := sqldb.QueryRow(sqlStatement)
|
||||||
var hash string
|
var hash string
|
||||||
|
|
@ -651,7 +681,7 @@ func GetRecentBlock(sqldb *sql.DB) string {
|
||||||
return string(json)
|
return string(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAllTransactionsFromBlock(sqldb *sql.DB, blockNumber string) string {
|
func SGetAllTransactionsFromBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
var arr txRes
|
var arr txRes
|
||||||
var txx string
|
var txx string
|
||||||
sqlStatement := `SELECT * FROM txs WHERE blocknumber=$1`
|
sqlStatement := `SELECT * FROM txs WHERE blocknumber=$1`
|
||||||
|
|
@ -719,7 +749,7 @@ func GetAllTransactionsFromBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
return txx
|
return txx
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAllBlocksMinedByAddress(sqldb *sql.DB, coinbase string) string {
|
func SGetAllBlocksMinedByAddress(sqldb *sql.DB, coinbase string) string {
|
||||||
var arr blockRes
|
var arr blockRes
|
||||||
var blockArr string
|
var blockArr string
|
||||||
sqlStatement := `SELECT * FROM blocks WHERE coinbase=$1`
|
sqlStatement := `SELECT * FROM blocks WHERE coinbase=$1`
|
||||||
|
|
@ -786,7 +816,7 @@ func GetAllBlocksMinedByAddress(sqldb *sql.DB, coinbase string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetAllTransactions getter fn for API
|
//GetAllTransactions getter fn for API
|
||||||
func GetAllTransactions(sqldb *sql.DB) string {
|
func SGetAllTransactions(sqldb *sql.DB) string {
|
||||||
var arr txRes
|
var arr txRes
|
||||||
var txx string
|
var txx string
|
||||||
rows, err := sqldb.Query(`
|
rows, err := sqldb.Query(`
|
||||||
|
|
@ -855,7 +885,7 @@ func GetAllTransactions(sqldb *sql.DB) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetTransaction fn returns single tx
|
//GetTransaction fn returns single tx
|
||||||
func GetTransaction(sqldb *sql.DB, txHash string) string {
|
func SGetTransaction(sqldb *sql.DB, txHash string) string {
|
||||||
sqlStatement := `SELECT * FROM txs WHERE txhash=$1;`
|
sqlStatement := `SELECT * FROM txs WHERE txhash=$1;`
|
||||||
row := sqldb.QueryRow(sqlStatement, txHash)
|
row := sqldb.QueryRow(sqlStatement, txHash)
|
||||||
var txhash string
|
var txhash string
|
||||||
|
|
@ -913,7 +943,7 @@ func GetTransaction(sqldb *sql.DB, txHash string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetAccount returns account balances
|
//GetAccount returns account balances
|
||||||
func GetAccount(sqldb *sql.DB, address string) string {
|
func SGetAccount(sqldb *sql.DB, address string) string {
|
||||||
sqlStatement := `SELECT * FROM accounts WHERE addr=$1;`
|
sqlStatement := `SELECT * FROM accounts WHERE addr=$1;`
|
||||||
row := sqldb.QueryRow(sqlStatement, address)
|
row := sqldb.QueryRow(sqlStatement, address)
|
||||||
var addr string
|
var addr string
|
||||||
|
|
@ -934,7 +964,7 @@ func GetAccount(sqldb *sql.DB, address string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetAllAccounts returns all accounts and balances
|
//GetAllAccounts returns all accounts and balances
|
||||||
func GetAllAccounts(sqldb *sql.DB) string {
|
func SGetAllAccounts(sqldb *sql.DB) string {
|
||||||
var array accountRes
|
var array accountRes
|
||||||
var accountsArr string
|
var accountsArr string
|
||||||
var txCountAccount string
|
var txCountAccount string
|
||||||
|
|
@ -973,7 +1003,7 @@ func GetAllAccounts(sqldb *sql.DB) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetAccount returns account balances
|
//GetAccount returns account balances
|
||||||
func GetAccountTxs(sqldb *sql.DB, address string) string {
|
func SGetAccountTxs(sqldb *sql.DB, address string) string {
|
||||||
var arr txRes
|
var arr txRes
|
||||||
var txx string
|
var txx string
|
||||||
sqlStatement := `SELECT * FROM txs WHERE to_addr=$1 OR from_addr=$1;`
|
sqlStatement := `SELECT * FROM txs WHERE to_addr=$1 OR from_addr=$1;`
|
||||||
|
|
@ -532,12 +532,6 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
|
||||||
// TraceTransaction returns the structured logs created during the execution of EVM
|
// TraceTransaction returns the structured logs created during the execution of EVM
|
||||||
// and returns them as a JSON object.
|
// and returns them as a JSON object.
|
||||||
func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
|
func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
|
||||||
fmt.Println("\n\n\t[API LOG]", api, "\n")
|
|
||||||
fmt.Printf("%+v\n", api.config)
|
|
||||||
fmt.Println("\n")
|
|
||||||
fmt.Printf("%+v\n", api.eth)
|
|
||||||
fmt.Println("\n")
|
|
||||||
// Retrieve the transaction and assemble its EVM context
|
|
||||||
tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash)
|
tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash)
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
return nil, fmt.Errorf("transaction %x not found", hash)
|
return nil, fmt.Errorf("transaction %x not found", hash)
|
||||||
|
|
@ -550,13 +544,95 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Ha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Trace the transaction and return
|
|
||||||
//fmt.Println("\n\n\t\tRETURN")
|
|
||||||
//fmt.Println(api.traceTx(ctx, msg, vmctx, statedb, config))
|
|
||||||
//fmt.Println("RETURN FINISHED")
|
|
||||||
return api.traceTx(ctx, msg, vmctx, statedb, config)
|
return api.traceTx(ctx, msg, vmctx, statedb, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TraceTransaction returns the structured logs created during the execution of EVM
|
||||||
|
// and returns them as a JSON object.
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
func (api *PrivateDebugAPI) STraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
|
||||||
|
// NOTE:SHYFT
|
||||||
|
tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash)
|
||||||
|
if tx == nil {
|
||||||
|
return nil, fmt.Errorf("transaction %x not found", hash)
|
||||||
|
}
|
||||||
|
reexec := defaultTraceReexec
|
||||||
|
if config != nil && config.Reexec != nil {
|
||||||
|
reexec = *config.Reexec
|
||||||
|
}
|
||||||
|
msg, vmctx, statedb, err := api.computeTxEnv(blockHash, int(index), reexec)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return api.StraceTx(ctx, msg, vmctx, statedb, config, hash)
|
||||||
|
}
|
||||||
|
|
||||||
|
// traceTx configures a new tracer according to the provided configuration, and
|
||||||
|
// executes the given message in the provided environment. The return value will
|
||||||
|
// be tracer dependent.
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
func (api *PrivateDebugAPI) StraceTx(ctx context.Context, message core.Message, vmctx vm.Context, statedb *state.StateDB, config *TraceConfig, hash common.Hash) (interface{}, error) {
|
||||||
|
// Assemble the structured logger or the JavaScript tracer
|
||||||
|
var (
|
||||||
|
tracer vm.Tracer
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
switch {
|
||||||
|
case config != nil && config.Tracer != nil:
|
||||||
|
// Define a meaningful timeout of a single transaction trace
|
||||||
|
_ = defaultTraceTimeout
|
||||||
|
|
||||||
|
if config.Timeout != nil {
|
||||||
|
if _, err = time.ParseDuration(*config.Timeout); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Constuct the JavaScript tracer to execute with
|
||||||
|
if tracer, err = tracers.New(*config.Tracer); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// @NOTE:SHYFT REMOVED CTX DEADLINE
|
||||||
|
// Handle timeouts and RPC cancellations
|
||||||
|
//deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||||
|
//go func() {
|
||||||
|
// <-deadlineCtx.Done()
|
||||||
|
// tracer.(*tracers.Tracer).Stop(errors.New("execution timeout"))
|
||||||
|
//}()
|
||||||
|
//defer cancel()
|
||||||
|
|
||||||
|
case config == nil:
|
||||||
|
tracer = vm.NewStructLogger(nil)
|
||||||
|
|
||||||
|
default:
|
||||||
|
tracer = vm.NewStructLogger(config.LogConfig)
|
||||||
|
}
|
||||||
|
// Run the transaction with tracing enabled.
|
||||||
|
vmenv := vm.NewEVM(vmctx, statedb, api.config, vm.Config{Debug: true, Tracer: tracer})
|
||||||
|
|
||||||
|
ret, gas, failed, err := core.ApplyMessage(vmenv, message, new(core.GasPool).AddGas(message.Gas()))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("tracing failed: %v", err)
|
||||||
|
}
|
||||||
|
// Depending on the tracer type, format and return the output
|
||||||
|
switch tracer := tracer.(type) {
|
||||||
|
case *vm.StructLogger:
|
||||||
|
return ðapi.ExecutionResult{
|
||||||
|
Gas: gas,
|
||||||
|
Failed: failed,
|
||||||
|
ReturnValue: fmt.Sprintf("%x", ret),
|
||||||
|
StructLogs: ethapi.FormatLogs(tracer.StructLogs()),
|
||||||
|
}, nil
|
||||||
|
|
||||||
|
case *tracers.Tracer:
|
||||||
|
return tracer.SGetResult(hash)
|
||||||
|
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("bad tracer type %T", tracer))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// traceTx configures a new tracer according to the provided configuration, and
|
// traceTx configures a new tracer according to the provided configuration, and
|
||||||
// executes the given message in the provided environment. The return value will
|
// executes the given message in the provided environment. The return value will
|
||||||
// be tracer dependent.
|
// be tracer dependent.
|
||||||
|
|
@ -569,7 +645,9 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
|
||||||
switch {
|
switch {
|
||||||
case config != nil && config.Tracer != nil:
|
case config != nil && config.Tracer != nil:
|
||||||
// Define a meaningful timeout of a single transaction trace
|
// Define a meaningful timeout of a single transaction trace
|
||||||
timeout := defaultTraceTimeout
|
|
||||||
|
timeout := defaultTraceTimeout
|
||||||
|
|
||||||
if config.Timeout != nil {
|
if config.Timeout != nil {
|
||||||
if timeout, err = time.ParseDuration(*config.Timeout); err != nil {
|
if timeout, err = time.ParseDuration(*config.Timeout); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -579,7 +657,7 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
|
||||||
if tracer, err = tracers.New(*config.Tracer); err != nil {
|
if tracer, err = tracers.New(*config.Tracer); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Handle timeouts and RPC cancellations
|
//Handle timeouts and RPC cancellations
|
||||||
deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
|
deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||||
go func() {
|
go func() {
|
||||||
<-deadlineCtx.Done()
|
<-deadlineCtx.Done()
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,10 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var BlockchainObject *core.BlockChain
|
||||||
|
|
||||||
|
var DebugApi PrivateDebugAPI
|
||||||
|
|
||||||
type LesServer interface {
|
type LesServer interface {
|
||||||
Start(srvr *p2p.Server)
|
Start(srvr *p2p.Server)
|
||||||
Stop()
|
Stop()
|
||||||
|
|
@ -98,22 +102,45 @@ func (s *Ethereum) AddLesServer(ls LesServer) {
|
||||||
ls.SetBloomBitsIndexer(s.bloomIndexer)
|
ls.SetBloomBitsIndexer(s.bloomIndexer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SNew(config *Config) (*Ethereum, error) {
|
||||||
|
stopDbUpgrade := upgradeDeduplicateData(Chaindb_global)
|
||||||
|
chainConfig, _, _ := core.SetupGenesisBlock(Chaindb_global, config.Genesis)
|
||||||
|
eth := &Ethereum{
|
||||||
|
config: config,
|
||||||
|
chainDb: Chaindb_global,
|
||||||
|
chainConfig: chainConfig,
|
||||||
|
shutdownChan: make(chan bool),
|
||||||
|
stopDbUpgrade: stopDbUpgrade,
|
||||||
|
networkId: config.NetworkId,
|
||||||
|
gasPrice: config.GasPrice,
|
||||||
|
etherbase: config.Etherbase,
|
||||||
|
bloomRequests: make(chan chan *bloombits.Retrieval),
|
||||||
|
bloomIndexer: NewBloomIndexer(Chaindb_global, params.BloomBitsBlocks),
|
||||||
|
}
|
||||||
|
|
||||||
|
eth.blockchain = BlockchainObject
|
||||||
|
|
||||||
|
return eth, nil
|
||||||
|
}
|
||||||
|
|
||||||
// New creates a new Ethereum object (including the
|
// New creates a new Ethereum object (including the
|
||||||
// initialisation of the common Ethereum object)
|
// initialisation of the common Ethereum object)
|
||||||
func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
|
shyft_tracer := new(ShyftTracer)
|
||||||
|
core.SetIShyftTracer(shyft_tracer)
|
||||||
|
SetGlobalConfig(config)
|
||||||
|
|
||||||
if config.SyncMode == downloader.LightSync {
|
if config.SyncMode == downloader.LightSync {
|
||||||
return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum")
|
return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum")
|
||||||
}
|
}
|
||||||
if !config.SyncMode.IsValid() {
|
if !config.SyncMode.IsValid() {
|
||||||
return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
|
return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
|
||||||
}
|
}
|
||||||
chainDb, err := CreateDB(ctx, config, "chaindata")
|
chainDb, err := chaindb(ctx, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: Create Genesis Block
|
|
||||||
|
|
||||||
stopDbUpgrade := upgradeDeduplicateData(chainDb)
|
stopDbUpgrade := upgradeDeduplicateData(chainDb)
|
||||||
chainConfig, genesisHash, genesisErr := core.SetupGenesisBlock(chainDb, config.Genesis)
|
chainConfig, genesisHash, genesisErr := core.SetupGenesisBlock(chainDb, config.Genesis)
|
||||||
if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok {
|
if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok {
|
||||||
|
|
@ -150,7 +177,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}
|
vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording}
|
||||||
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieNodeLimit: config.TrieCache, TrieTimeLimit: config.TrieTimeout}
|
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieNodeLimit: config.TrieCache, TrieTimeLimit: config.TrieTimeout}
|
||||||
)
|
)
|
||||||
|
|
||||||
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, eth.chainConfig, eth.engine, vmConfig)
|
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, eth.chainConfig, eth.engine, vmConfig)
|
||||||
|
|
||||||
|
BlockchainObject = eth.blockchain
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -180,6 +211,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams)
|
eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams)
|
||||||
|
|
||||||
|
DebugApi.eth = eth
|
||||||
|
DebugApi.config = chainConfig
|
||||||
|
//@NOTE Shyft Tracer
|
||||||
|
InitTracerEnv()
|
||||||
|
|
||||||
return eth, nil
|
return eth, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
45
eth/chaindb.go
Normal file
45
eth/chaindb.go
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
package eth
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
|
"github.com/ethereum/go-ethereum/node"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
var Chaindb_global ethdb.Database
|
||||||
|
|
||||||
|
func SetChainDB(db ethdb.Database){
|
||||||
|
Chaindb_global = db
|
||||||
|
}
|
||||||
|
|
||||||
|
func chaindb(ctx *node.ServiceContext, config *Config) (ethdb.Database, error) {
|
||||||
|
if Chaindb_global != nil {
|
||||||
|
return Chaindb_global, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
chainDb, err := CreateDB(ctx, config, "chaindata")
|
||||||
|
if err == nil {
|
||||||
|
SetChainDB(chainDb)
|
||||||
|
return Chaindb_global, nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//(*ethdb.LDBDatabase, func())
|
||||||
|
func NewShyftTestLDB() {
|
||||||
|
dirname, err := ioutil.TempDir(os.TempDir(), "shyftdb_test_")
|
||||||
|
if err != nil {
|
||||||
|
panic("failed to create test file: " + err.Error())
|
||||||
|
}
|
||||||
|
db, err := ethdb.NewLDBDatabase(dirname, 0, 0)
|
||||||
|
if err != nil {
|
||||||
|
panic("failed to create test database: " + err.Error())
|
||||||
|
}
|
||||||
|
Chaindb_global = db
|
||||||
|
|
||||||
|
//return db, func() {
|
||||||
|
// db.Close()
|
||||||
|
// os.RemoveAll(dirname)
|
||||||
|
//}
|
||||||
|
}
|
||||||
48
eth/shyft_tracer.go
Normal file
48
eth/shyft_tracer.go
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
package eth
|
||||||
|
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
var EthereumObject interface{}
|
||||||
|
|
||||||
|
type ShyftTracer struct {}
|
||||||
|
|
||||||
|
var PrivateAPI *PrivateDebugAPI
|
||||||
|
var Context context.Context
|
||||||
|
var TracerConfig *TraceConfig
|
||||||
|
|
||||||
|
func InitTracerEnv() {
|
||||||
|
config2 := params.ShyftNetworkChainConfig
|
||||||
|
|
||||||
|
jsTracer := "callTracer"
|
||||||
|
var ctx2 context.Context
|
||||||
|
Context = ctx2
|
||||||
|
config := &TraceConfig{
|
||||||
|
LogConfig: nil,
|
||||||
|
Tracer: &jsTracer, // needs to be non-nil
|
||||||
|
Timeout: nil,
|
||||||
|
Reexec: nil,
|
||||||
|
}
|
||||||
|
TracerConfig = config
|
||||||
|
fullNode, _ := SNew(Global_config)
|
||||||
|
privateAPI := NewPrivateDebugAPI(config2, fullNode)
|
||||||
|
PrivateAPI = privateAPI
|
||||||
|
}
|
||||||
|
|
||||||
|
func (st ShyftTracer) GetTracerToRun (hash common.Hash) (interface{}, error) {
|
||||||
|
return PrivateAPI.STraceTransaction(Context, hash, TracerConfig)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setEthObject(ethobj interface{}){
|
||||||
|
EthereumObject = ethobj
|
||||||
|
}
|
||||||
|
|
||||||
|
var Global_config *Config
|
||||||
|
|
||||||
|
func SetGlobalConfig(c *Config) {
|
||||||
|
Global_config = c
|
||||||
|
}
|
||||||
|
|
@ -27,10 +27,11 @@ import (
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
duktape "gopkg.in/olebedev/go-duktape.v3"
|
"gopkg.in/olebedev/go-duktape.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
|
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
|
||||||
|
|
@ -311,6 +312,7 @@ func New(code string) (*Tracer, error) {
|
||||||
if tracer, ok := tracer(code); ok {
|
if tracer, ok := tracer(code); ok {
|
||||||
code = tracer
|
code = tracer
|
||||||
}
|
}
|
||||||
|
|
||||||
tracer := &Tracer{
|
tracer := &Tracer{
|
||||||
vm: duktape.New(),
|
vm: duktape.New(),
|
||||||
ctx: make(map[string]interface{}),
|
ctx: make(map[string]interface{}),
|
||||||
|
|
@ -324,6 +326,7 @@ func New(code string) (*Tracer, error) {
|
||||||
costValue: new(uint),
|
costValue: new(uint),
|
||||||
depthValue: new(uint),
|
depthValue: new(uint),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up builtins for this environment
|
// Set up builtins for this environment
|
||||||
tracer.vm.PushGlobalGoFunction("toHex", func(ctx *duktape.Context) int {
|
tracer.vm.PushGlobalGoFunction("toHex", func(ctx *duktape.Context) int {
|
||||||
ctx.PushString(hexutil.Encode(popSlice(ctx)))
|
ctx.PushString(hexutil.Encode(popSlice(ctx)))
|
||||||
|
|
@ -456,7 +459,6 @@ func New(code string) (*Tracer, error) {
|
||||||
|
|
||||||
tracer.dbWrapper.pushObject(tracer.vm)
|
tracer.dbWrapper.pushObject(tracer.vm)
|
||||||
tracer.vm.PutPropString(tracer.stateObject, "db")
|
tracer.vm.PutPropString(tracer.stateObject, "db")
|
||||||
|
|
||||||
return tracer, nil
|
return tracer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -496,9 +498,6 @@ func wrapError(context string, err error) error {
|
||||||
|
|
||||||
// CaptureStart implements the Tracer interface to initialize the tracing operation.
|
// CaptureStart implements the Tracer interface to initialize the tracing operation.
|
||||||
func (jst *Tracer) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error {
|
func (jst *Tracer) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error {
|
||||||
//fmt.Println("\n\n\t\t type: ", reflect.TypeOf(input))
|
|
||||||
fmt.Println("\t\t [TRACER INPUT]:", input)
|
|
||||||
fmt.Println("\t\t [TRACER INPUT STRING]:", string(input[:len(input)]), "\n\n")
|
|
||||||
jst.ctx["type"] = "CALL"
|
jst.ctx["type"] = "CALL"
|
||||||
if create {
|
if create {
|
||||||
jst.ctx["type"] = "CREATE"
|
jst.ctx["type"] = "CREATE"
|
||||||
|
|
@ -567,9 +566,6 @@ func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost
|
||||||
|
|
||||||
// CaptureEnd is called after the call finishes to finalize the tracing.
|
// CaptureEnd is called after the call finishes to finalize the tracing.
|
||||||
func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error {
|
func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error {
|
||||||
//fmt.Println("\n\n\t\t", reflect.TypeOf(output))
|
|
||||||
fmt.Println("\t\t [TRACER OUTPUT]:", output[:len(output)])
|
|
||||||
fmt.Println("\t\t [TRACER OUTPUT STRING]:", string(output[:len(output)]), "\n\n")
|
|
||||||
jst.ctx["output"] = output
|
jst.ctx["output"] = output
|
||||||
jst.ctx["gasUsed"] = gasUsed
|
jst.ctx["gasUsed"] = gasUsed
|
||||||
jst.ctx["time"] = t.String()
|
jst.ctx["time"] = t.String()
|
||||||
|
|
@ -580,6 +576,52 @@ func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, er
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
type Internals struct {
|
||||||
|
Type string
|
||||||
|
From string
|
||||||
|
To string
|
||||||
|
Value string
|
||||||
|
Gas string
|
||||||
|
GasUsed string
|
||||||
|
Input string
|
||||||
|
Output string
|
||||||
|
Time string
|
||||||
|
Calls []*Internals
|
||||||
|
}
|
||||||
|
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
func (i *Internals) SWriteInteralTxs(hash common.Hash) {
|
||||||
|
sqldb, err := core.DBConnection()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gas, _ := hexutil.DecodeUint64(i.Gas)
|
||||||
|
gasUsed, _ := hexutil.DecodeUint64(i.GasUsed)
|
||||||
|
|
||||||
|
var returnValue string
|
||||||
|
sqlStatement := `INSERT INTO internaltxs(type, txhash, from_addr, to_addr, amount, gas, gasUsed, time, input, output) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10)) RETURNING txHash`
|
||||||
|
qerr := sqldb.QueryRow(sqlStatement, i.Type, hash.Hex(), i.From, i.To, i.Value, gas, gasUsed, i.Time, i.Input, i.Output).Scan(&returnValue)
|
||||||
|
|
||||||
|
if qerr != nil {
|
||||||
|
fmt.Println(qerr)
|
||||||
|
panic(qerr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
func (i *Internals) InternalRecursive(hash common.Hash) {
|
||||||
|
i.SWriteInteralTxs(hash)
|
||||||
|
lengthOfCalls := len(i.Calls)
|
||||||
|
if lengthOfCalls == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, val := range i.Calls {
|
||||||
|
val.InternalRecursive(hash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GetResult calls the Javascript 'result' function and returns its value, or any accumulated error
|
// GetResult calls the Javascript 'result' function and returns its value, or any accumulated error
|
||||||
func (jst *Tracer) GetResult() (json.RawMessage, error) {
|
func (jst *Tracer) GetResult() (json.RawMessage, error) {
|
||||||
// Transform the context into a JavaScript object and inject into the state
|
// Transform the context into a JavaScript object and inject into the state
|
||||||
|
|
@ -622,3 +664,55 @@ func (jst *Tracer) GetResult() (json.RawMessage, error) {
|
||||||
|
|
||||||
return result, jst.err
|
return result, jst.err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetResult calls the Javascript 'result' function and returns its value, or any accumulated error
|
||||||
|
|
||||||
|
//@NOTE:SHYFT
|
||||||
|
func (jst *Tracer) SGetResult(hash common.Hash) (json.RawMessage, error) {
|
||||||
|
// Transform the context into a JavaScript object and inject into the state
|
||||||
|
obj := jst.vm.PushObject()
|
||||||
|
|
||||||
|
for key, val := range jst.ctx {
|
||||||
|
switch val := val.(type) {
|
||||||
|
case uint64:
|
||||||
|
jst.vm.PushUint(uint(val))
|
||||||
|
|
||||||
|
case string:
|
||||||
|
jst.vm.PushString(val)
|
||||||
|
|
||||||
|
case []byte:
|
||||||
|
ptr := jst.vm.PushFixedBuffer(len(val))
|
||||||
|
copy(makeSlice(ptr, uint(len(val))), val[:])
|
||||||
|
|
||||||
|
case common.Address:
|
||||||
|
ptr := jst.vm.PushFixedBuffer(20)
|
||||||
|
copy(makeSlice(ptr, 20), val[:])
|
||||||
|
|
||||||
|
case *big.Int:
|
||||||
|
pushBigInt(val, jst.vm)
|
||||||
|
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("unsupported type: %T", val))
|
||||||
|
}
|
||||||
|
jst.vm.PutPropString(obj, key)
|
||||||
|
}
|
||||||
|
jst.vm.PutPropString(jst.stateObject, "ctx")
|
||||||
|
|
||||||
|
// Finalize the trace and return the results
|
||||||
|
result, err := jst.call("result", "ctx", "db")
|
||||||
|
if err != nil {
|
||||||
|
jst.err = wrapError("result", err)
|
||||||
|
}
|
||||||
|
// Clean up the JavaScript environment
|
||||||
|
jst.vm.DestroyHeap()
|
||||||
|
jst.vm.Destroy()
|
||||||
|
|
||||||
|
var dat Internals
|
||||||
|
|
||||||
|
if err := json.Unmarshal(result, &dat); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
dat.InternalRecursive(hash)
|
||||||
|
|
||||||
|
return result, jst.err
|
||||||
|
}
|
||||||
9
ethObjectInterface/eth_object.go
Normal file
9
ethObjectInterface/eth_object.go
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
package ethObjectInterface
|
||||||
|
|
||||||
|
import "github.com/ethereum/go-ethereum/eth"
|
||||||
|
|
||||||
|
//var ethObject *eth.Ethereum
|
||||||
|
|
||||||
|
func GetEthObject() (interface{}){
|
||||||
|
return eth.EthObject
|
||||||
|
}
|
||||||
|
|
@ -309,6 +309,7 @@ func (self *worker) wait() {
|
||||||
for _, log := range work.state.Logs() {
|
for _, log := range work.state.Logs() {
|
||||||
log.BlockHash = block.Hash()
|
log.BlockHash = block.Hash()
|
||||||
}
|
}
|
||||||
|
// NOTE:SHYFT Added eth to writeBlockWithState
|
||||||
stat, err := self.chain.WriteBlockWithState(block, work.receipts, work.state)
|
stat, err := self.chain.WriteBlockWithState(block, work.receipts, work.state)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed writing block to chain", "err", err)
|
log.Error("Failed writing block to chain", "err", err)
|
||||||
|
|
|
||||||
|
|
@ -642,7 +642,6 @@ func (n *Node) EventMux() *event.TypeMux {
|
||||||
// previous can be found) from within the node's instance directory. If the node is
|
// previous can be found) from within the node's instance directory. If the node is
|
||||||
// ephemeral, a memory database is returned.
|
// ephemeral, a memory database is returned.
|
||||||
func (n *Node) OpenDatabase(name string, cache, handles int) (ethdb.Database, error) {
|
func (n *Node) OpenDatabase(name string, cache, handles int) (ethdb.Database, error) {
|
||||||
fmt.Println("DSAhhysagdhkajsndjgasuygdvkhasbdjhs")
|
|
||||||
if n.config.DataDir == "" {
|
if n.config.DataDir == "" {
|
||||||
return ethdb.NewMemDatabase()
|
return ethdb.NewMemDatabase()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS blocks (
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS txs (
|
CREATE TABLE IF NOT EXISTS txs (
|
||||||
txHash text,
|
txHash text primary key unique,
|
||||||
to_addr text,
|
to_addr text,
|
||||||
from_addr text,
|
from_addr text,
|
||||||
blockhash text references blocks(hash),
|
blockhash text references blocks(hash),
|
||||||
|
|
@ -39,3 +39,20 @@ CREATE TABLE IF NOT EXISTS accounts (
|
||||||
txCountAccount numeric
|
txCountAccount numeric
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS contracts (
|
||||||
|
txHash text
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS internalTxs (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
txHash text references txs(txHash),
|
||||||
|
type text,
|
||||||
|
to_addr text,
|
||||||
|
from_addr text,
|
||||||
|
amount text,
|
||||||
|
gas numeric,
|
||||||
|
gasUsed numeric,
|
||||||
|
time text,
|
||||||
|
input text,
|
||||||
|
output text
|
||||||
|
)
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
DROP TABLE internalTxs;
|
||||||
DROP TABLE txs;
|
DROP TABLE txs;
|
||||||
DROP TABLE blocks;
|
DROP TABLE blocks;
|
||||||
DROP TABLE accounts;
|
DROP TABLE accounts;
|
||||||
|
DROP TABLE contracts;
|
||||||
|
|
@ -64,14 +64,14 @@
|
||||||
"type": "function"
|
"type": "function"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102f8806100606000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a7230582081dfbd8174037e45d69fcbe70d6680c7a2138f79ab9ba39bdffaa14fb7854aa50029",
|
"bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102f8806100606000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a723058204322c068e2f4ea0c2c75a1ad943ff4d1badcc839aea20ef91d899284e74d911b0029",
|
||||||
"deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a7230582081dfbd8174037e45d69fcbe70d6680c7a2138f79ab9ba39bdffaa14fb7854aa50029",
|
"deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a723058204322c068e2f4ea0c2c75a1ad943ff4d1badcc839aea20ef91d899284e74d911b0029",
|
||||||
"sourceMap": "26:480:0:-;;;115:50;8:9:-1;5:2;;;30:1;27;20:12;5:2;115:50:0;150:10;142:5;;:18;;;;;;;;;;;;;;;;;;26:480;;;;;;",
|
"sourceMap": "26:488:0:-;;;115:58;8:9:-1;5:2;;;30:1;27;20:12;5:2;115:58:0;158:10;150:5;;:18;;;;;;;;;;;;;;;;;;26:488;;;;;;",
|
||||||
"deployedSourceMap": "26:480:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;339:165;;8:9:-1;5:2;;;30:1;27;20:12;5:2;339:165:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:36;;8:9:-1;5:2;;;30:1;27;20:12;5:2;74:36:0;;;;;;;;;;;;;;;;;;;;;;;50:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;232:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;232:103:0;;;;;;;;;;;;;;;;;;;;;;;;;;339:165;401:19;215:5;;;;;;;;;;;201:19;;:10;:19;;;197:26;;;434:11;401:45;;452:8;:21;;;474:24;;452:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;452:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;452:47:0;;;;197:26;339:165;;:::o;74:36::-;;;;:::o;50:20::-;;;;;;;;;;;;;:::o;232:103::-;215:5;;;;;;;;;;;201:19;;:10;:19;;;197:26;;;321:9;294:24;:36;;;;197:26;232:103;:::o",
|
"deployedSourceMap": "26:488:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;347:165;;8:9:-1;5:2;;;30:1;27;20:12;5:2;347:165:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:36;;8:9:-1;5:2;;;30:1;27;20:12;5:2;74:36:0;;;;;;;;;;;;;;;;;;;;;;;50:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;240:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;240:103:0;;;;;;;;;;;;;;;;;;;;;;;;;;347:165;409:19;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;442:11;409:45;;460:8;:21;;;482:24;;460:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;460:47:0;;;;205:26;347:165;;:::o;74:36::-;;;;:::o;50:20::-;;;;;;;;;;;;;:::o;240:103::-;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;329:9;302:24;:36;;;;205:26;240:103;:::o",
|
||||||
"source": "pragma solidity ^0.4.23;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n",
|
"source": "pragma solidity ^0.4.23;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n function Migrations() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n",
|
||||||
"sourcePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
"sourcePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
||||||
"ast": {
|
"ast": {
|
||||||
"absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
"absolutePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
||||||
"exportedSymbols": {
|
"exportedSymbols": {
|
||||||
"Migrations": [
|
"Migrations": [
|
||||||
56
|
56
|
||||||
|
|
@ -160,7 +160,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 13,
|
"id": 13,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "136:29:0",
|
"src": "144:29:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 3,
|
"referencedDeclaration": 3,
|
||||||
"src": "142:5:0",
|
"src": "150:5:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -194,7 +194,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 264,
|
"referencedDeclaration": 264,
|
||||||
"src": "150:3:0",
|
"src": "158:3:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_magic_message",
|
"typeIdentifier": "t_magic_message",
|
||||||
"typeString": "msg"
|
"typeString": "msg"
|
||||||
|
|
@ -208,13 +208,13 @@
|
||||||
"memberName": "sender",
|
"memberName": "sender",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": null,
|
"referencedDeclaration": null,
|
||||||
"src": "150:10:0",
|
"src": "158:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "142:18:0",
|
"src": "150:18:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
},
|
},
|
||||||
"id": 12,
|
"id": 12,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "142:18:0"
|
"src": "150:18:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -232,23 +232,23 @@
|
||||||
"isConstructor": true,
|
"isConstructor": true,
|
||||||
"isDeclaredConst": false,
|
"isDeclaredConst": false,
|
||||||
"modifiers": [],
|
"modifiers": [],
|
||||||
"name": "",
|
"name": "Migrations",
|
||||||
"nodeType": "FunctionDefinition",
|
"nodeType": "FunctionDefinition",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "126:2:0"
|
"src": "134:2:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "136:0:0"
|
"src": "144:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "115:50:0",
|
"src": "115:58:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
|
|
@ -257,7 +257,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 22,
|
"id": 22,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "191:37:0",
|
"src": "199:37:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"condition": {
|
"condition": {
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 264,
|
"referencedDeclaration": 264,
|
||||||
"src": "201:3:0",
|
"src": "209:3:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_magic_message",
|
"typeIdentifier": "t_magic_message",
|
||||||
"typeString": "msg"
|
"typeString": "msg"
|
||||||
|
|
@ -294,7 +294,7 @@
|
||||||
"memberName": "sender",
|
"memberName": "sender",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": null,
|
"referencedDeclaration": null,
|
||||||
"src": "201:10:0",
|
"src": "209:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -309,13 +309,13 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 3,
|
"referencedDeclaration": 3,
|
||||||
"src": "215:5:0",
|
"src": "223:5:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "201:19:0",
|
"src": "209:19:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_bool",
|
"typeIdentifier": "t_bool",
|
||||||
"typeString": "bool"
|
"typeString": "bool"
|
||||||
|
|
@ -324,11 +324,11 @@
|
||||||
"falseBody": null,
|
"falseBody": null,
|
||||||
"id": 21,
|
"id": 21,
|
||||||
"nodeType": "IfStatement",
|
"nodeType": "IfStatement",
|
||||||
"src": "197:26:0",
|
"src": "205:26:0",
|
||||||
"trueBody": {
|
"trueBody": {
|
||||||
"id": 20,
|
"id": 20,
|
||||||
"nodeType": "PlaceholderStatement",
|
"nodeType": "PlaceholderStatement",
|
||||||
"src": "222:1:0"
|
"src": "230:1:0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -341,16 +341,16 @@
|
||||||
"id": 15,
|
"id": 15,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "188:2:0"
|
"src": "196:2:0"
|
||||||
},
|
},
|
||||||
"src": "169:59:0",
|
"src": "177:59:0",
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"body": {
|
"body": {
|
||||||
"id": 34,
|
"id": 34,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "288:47:0",
|
"src": "296:47:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -367,7 +367,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 5,
|
"referencedDeclaration": 5,
|
||||||
"src": "294:24:0",
|
"src": "302:24:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -382,13 +382,13 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 25,
|
"referencedDeclaration": 25,
|
||||||
"src": "321:9:0",
|
"src": "329:9:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "294:36:0",
|
"src": "302:36:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -396,7 +396,7 @@
|
||||||
},
|
},
|
||||||
"id": 33,
|
"id": 33,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "294:36:0"
|
"src": "302:36:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -416,14 +416,14 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 23,
|
"referencedDeclaration": 23,
|
||||||
"src": "277:10:0",
|
"src": "285:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_modifier$__$",
|
"typeIdentifier": "t_modifier$__$",
|
||||||
"typeString": "modifier ()"
|
"typeString": "modifier ()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "ModifierInvocation",
|
"nodeType": "ModifierInvocation",
|
||||||
"src": "277:10:0"
|
"src": "285:10:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "setCompleted",
|
"name": "setCompleted",
|
||||||
|
|
@ -438,7 +438,7 @@
|
||||||
"name": "completed",
|
"name": "completed",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 35,
|
"scope": 35,
|
||||||
"src": "254:14:0",
|
"src": "262:14:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -449,7 +449,7 @@
|
||||||
"id": 24,
|
"id": 24,
|
||||||
"name": "uint",
|
"name": "uint",
|
||||||
"nodeType": "ElementaryTypeName",
|
"nodeType": "ElementaryTypeName",
|
||||||
"src": "254:4:0",
|
"src": "262:4:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -459,17 +459,17 @@
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "253:16:0"
|
"src": "261:16:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 29,
|
"id": 29,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "288:0:0"
|
"src": "296:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "232:103:0",
|
"src": "240:103:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
|
|
@ -478,7 +478,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 54,
|
"id": 54,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "395:109:0",
|
"src": "403:109:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"assignments": [
|
"assignments": [
|
||||||
|
|
@ -491,7 +491,7 @@
|
||||||
"name": "upgraded",
|
"name": "upgraded",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 55,
|
"scope": 55,
|
||||||
"src": "401:19:0",
|
"src": "409:19:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -504,7 +504,7 @@
|
||||||
"name": "Migrations",
|
"name": "Migrations",
|
||||||
"nodeType": "UserDefinedTypeName",
|
"nodeType": "UserDefinedTypeName",
|
||||||
"referencedDeclaration": 56,
|
"referencedDeclaration": 56,
|
||||||
"src": "401:10:0",
|
"src": "409:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
|
|
@ -525,7 +525,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 37,
|
"referencedDeclaration": 37,
|
||||||
"src": "434:11:0",
|
"src": "442:11:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -544,7 +544,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 56,
|
"referencedDeclaration": 56,
|
||||||
"src": "423:10:0",
|
"src": "431:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_type$_t_contract$_Migrations_$56_$",
|
"typeIdentifier": "t_type$_t_contract$_Migrations_$56_$",
|
||||||
"typeString": "type(contract Migrations)"
|
"typeString": "type(contract Migrations)"
|
||||||
|
|
@ -558,14 +558,14 @@
|
||||||
"lValueRequested": false,
|
"lValueRequested": false,
|
||||||
"names": [],
|
"names": [],
|
||||||
"nodeType": "FunctionCall",
|
"nodeType": "FunctionCall",
|
||||||
"src": "423:23:0",
|
"src": "431:23:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "VariableDeclarationStatement",
|
"nodeType": "VariableDeclarationStatement",
|
||||||
"src": "401:45:0"
|
"src": "409:45:0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 5,
|
"referencedDeclaration": 5,
|
||||||
"src": "474:24:0",
|
"src": "482:24:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -599,7 +599,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 43,
|
"referencedDeclaration": 43,
|
||||||
"src": "452:8:0",
|
"src": "460:8:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
|
|
@ -613,7 +613,7 @@
|
||||||
"memberName": "setCompleted",
|
"memberName": "setCompleted",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": 35,
|
"referencedDeclaration": 35,
|
||||||
"src": "452:21:0",
|
"src": "460:21:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
|
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
|
||||||
"typeString": "function (uint256) external"
|
"typeString": "function (uint256) external"
|
||||||
|
|
@ -627,7 +627,7 @@
|
||||||
"lValueRequested": false,
|
"lValueRequested": false,
|
||||||
"names": [],
|
"names": [],
|
||||||
"nodeType": "FunctionCall",
|
"nodeType": "FunctionCall",
|
||||||
"src": "452:47:0",
|
"src": "460:47:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_tuple$__$",
|
"typeIdentifier": "t_tuple$__$",
|
||||||
"typeString": "tuple()"
|
"typeString": "tuple()"
|
||||||
|
|
@ -635,7 +635,7 @@
|
||||||
},
|
},
|
||||||
"id": 53,
|
"id": 53,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "452:47:0"
|
"src": "460:47:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -655,14 +655,14 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 23,
|
"referencedDeclaration": 23,
|
||||||
"src": "384:10:0",
|
"src": "392:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_modifier$__$",
|
"typeIdentifier": "t_modifier$__$",
|
||||||
"typeString": "modifier ()"
|
"typeString": "modifier ()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "ModifierInvocation",
|
"nodeType": "ModifierInvocation",
|
||||||
"src": "384:10:0"
|
"src": "392:10:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "upgrade",
|
"name": "upgrade",
|
||||||
|
|
@ -677,7 +677,7 @@
|
||||||
"name": "new_address",
|
"name": "new_address",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 55,
|
"scope": 55,
|
||||||
"src": "356:19:0",
|
"src": "364:19:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -688,7 +688,7 @@
|
||||||
"id": 36,
|
"id": 36,
|
||||||
"name": "address",
|
"name": "address",
|
||||||
"nodeType": "ElementaryTypeName",
|
"nodeType": "ElementaryTypeName",
|
||||||
"src": "356:7:0",
|
"src": "364:7:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -698,30 +698,30 @@
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "355:21:0"
|
"src": "363:21:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 41,
|
"id": 41,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "395:0:0"
|
"src": "403:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "339:165:0",
|
"src": "347:165:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scope": 57,
|
"scope": 57,
|
||||||
"src": "26:480:0"
|
"src": "26:488:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "0:507:0"
|
"src": "0:515:0"
|
||||||
},
|
},
|
||||||
"legacyAST": {
|
"legacyAST": {
|
||||||
"absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
"absolutePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol",
|
||||||
"exportedSymbols": {
|
"exportedSymbols": {
|
||||||
"Migrations": [
|
"Migrations": [
|
||||||
56
|
56
|
||||||
|
|
@ -810,7 +810,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 13,
|
"id": 13,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "136:29:0",
|
"src": "144:29:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -827,7 +827,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 3,
|
"referencedDeclaration": 3,
|
||||||
"src": "142:5:0",
|
"src": "150:5:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -844,7 +844,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 264,
|
"referencedDeclaration": 264,
|
||||||
"src": "150:3:0",
|
"src": "158:3:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_magic_message",
|
"typeIdentifier": "t_magic_message",
|
||||||
"typeString": "msg"
|
"typeString": "msg"
|
||||||
|
|
@ -858,13 +858,13 @@
|
||||||
"memberName": "sender",
|
"memberName": "sender",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": null,
|
"referencedDeclaration": null,
|
||||||
"src": "150:10:0",
|
"src": "158:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "142:18:0",
|
"src": "150:18:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -872,7 +872,7 @@
|
||||||
},
|
},
|
||||||
"id": 12,
|
"id": 12,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "142:18:0"
|
"src": "150:18:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -882,23 +882,23 @@
|
||||||
"isConstructor": true,
|
"isConstructor": true,
|
||||||
"isDeclaredConst": false,
|
"isDeclaredConst": false,
|
||||||
"modifiers": [],
|
"modifiers": [],
|
||||||
"name": "",
|
"name": "Migrations",
|
||||||
"nodeType": "FunctionDefinition",
|
"nodeType": "FunctionDefinition",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "126:2:0"
|
"src": "134:2:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "136:0:0"
|
"src": "144:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "115:50:0",
|
"src": "115:58:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
|
|
@ -907,7 +907,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 22,
|
"id": 22,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "191:37:0",
|
"src": "199:37:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"condition": {
|
"condition": {
|
||||||
|
|
@ -930,7 +930,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 264,
|
"referencedDeclaration": 264,
|
||||||
"src": "201:3:0",
|
"src": "209:3:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_magic_message",
|
"typeIdentifier": "t_magic_message",
|
||||||
"typeString": "msg"
|
"typeString": "msg"
|
||||||
|
|
@ -944,7 +944,7 @@
|
||||||
"memberName": "sender",
|
"memberName": "sender",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": null,
|
"referencedDeclaration": null,
|
||||||
"src": "201:10:0",
|
"src": "209:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -959,13 +959,13 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 3,
|
"referencedDeclaration": 3,
|
||||||
"src": "215:5:0",
|
"src": "223:5:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "201:19:0",
|
"src": "209:19:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_bool",
|
"typeIdentifier": "t_bool",
|
||||||
"typeString": "bool"
|
"typeString": "bool"
|
||||||
|
|
@ -974,11 +974,11 @@
|
||||||
"falseBody": null,
|
"falseBody": null,
|
||||||
"id": 21,
|
"id": 21,
|
||||||
"nodeType": "IfStatement",
|
"nodeType": "IfStatement",
|
||||||
"src": "197:26:0",
|
"src": "205:26:0",
|
||||||
"trueBody": {
|
"trueBody": {
|
||||||
"id": 20,
|
"id": 20,
|
||||||
"nodeType": "PlaceholderStatement",
|
"nodeType": "PlaceholderStatement",
|
||||||
"src": "222:1:0"
|
"src": "230:1:0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -991,16 +991,16 @@
|
||||||
"id": 15,
|
"id": 15,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "188:2:0"
|
"src": "196:2:0"
|
||||||
},
|
},
|
||||||
"src": "169:59:0",
|
"src": "177:59:0",
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"body": {
|
"body": {
|
||||||
"id": 34,
|
"id": 34,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "288:47:0",
|
"src": "296:47:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -1017,7 +1017,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 5,
|
"referencedDeclaration": 5,
|
||||||
"src": "294:24:0",
|
"src": "302:24:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -1032,13 +1032,13 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 25,
|
"referencedDeclaration": 25,
|
||||||
"src": "321:9:0",
|
"src": "329:9:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src": "294:36:0",
|
"src": "302:36:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -1046,7 +1046,7 @@
|
||||||
},
|
},
|
||||||
"id": 33,
|
"id": 33,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "294:36:0"
|
"src": "302:36:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -1066,14 +1066,14 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 23,
|
"referencedDeclaration": 23,
|
||||||
"src": "277:10:0",
|
"src": "285:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_modifier$__$",
|
"typeIdentifier": "t_modifier$__$",
|
||||||
"typeString": "modifier ()"
|
"typeString": "modifier ()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "ModifierInvocation",
|
"nodeType": "ModifierInvocation",
|
||||||
"src": "277:10:0"
|
"src": "285:10:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "setCompleted",
|
"name": "setCompleted",
|
||||||
|
|
@ -1088,7 +1088,7 @@
|
||||||
"name": "completed",
|
"name": "completed",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 35,
|
"scope": 35,
|
||||||
"src": "254:14:0",
|
"src": "262:14:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -1099,7 +1099,7 @@
|
||||||
"id": 24,
|
"id": 24,
|
||||||
"name": "uint",
|
"name": "uint",
|
||||||
"nodeType": "ElementaryTypeName",
|
"nodeType": "ElementaryTypeName",
|
||||||
"src": "254:4:0",
|
"src": "262:4:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -1109,17 +1109,17 @@
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "253:16:0"
|
"src": "261:16:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 29,
|
"id": 29,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "288:0:0"
|
"src": "296:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "232:103:0",
|
"src": "240:103:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
|
|
@ -1128,7 +1128,7 @@
|
||||||
"body": {
|
"body": {
|
||||||
"id": 54,
|
"id": 54,
|
||||||
"nodeType": "Block",
|
"nodeType": "Block",
|
||||||
"src": "395:109:0",
|
"src": "403:109:0",
|
||||||
"statements": [
|
"statements": [
|
||||||
{
|
{
|
||||||
"assignments": [
|
"assignments": [
|
||||||
|
|
@ -1141,7 +1141,7 @@
|
||||||
"name": "upgraded",
|
"name": "upgraded",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 55,
|
"scope": 55,
|
||||||
"src": "401:19:0",
|
"src": "409:19:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -1154,7 +1154,7 @@
|
||||||
"name": "Migrations",
|
"name": "Migrations",
|
||||||
"nodeType": "UserDefinedTypeName",
|
"nodeType": "UserDefinedTypeName",
|
||||||
"referencedDeclaration": 56,
|
"referencedDeclaration": 56,
|
||||||
"src": "401:10:0",
|
"src": "409:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
|
|
@ -1175,7 +1175,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 37,
|
"referencedDeclaration": 37,
|
||||||
"src": "434:11:0",
|
"src": "442:11:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -1194,7 +1194,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 56,
|
"referencedDeclaration": 56,
|
||||||
"src": "423:10:0",
|
"src": "431:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_type$_t_contract$_Migrations_$56_$",
|
"typeIdentifier": "t_type$_t_contract$_Migrations_$56_$",
|
||||||
"typeString": "type(contract Migrations)"
|
"typeString": "type(contract Migrations)"
|
||||||
|
|
@ -1208,14 +1208,14 @@
|
||||||
"lValueRequested": false,
|
"lValueRequested": false,
|
||||||
"names": [],
|
"names": [],
|
||||||
"nodeType": "FunctionCall",
|
"nodeType": "FunctionCall",
|
||||||
"src": "423:23:0",
|
"src": "431:23:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "VariableDeclarationStatement",
|
"nodeType": "VariableDeclarationStatement",
|
||||||
"src": "401:45:0"
|
"src": "409:45:0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expression": {
|
"expression": {
|
||||||
|
|
@ -1228,7 +1228,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 5,
|
"referencedDeclaration": 5,
|
||||||
"src": "474:24:0",
|
"src": "482:24:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_uint256",
|
"typeIdentifier": "t_uint256",
|
||||||
"typeString": "uint256"
|
"typeString": "uint256"
|
||||||
|
|
@ -1249,7 +1249,7 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 43,
|
"referencedDeclaration": 43,
|
||||||
"src": "452:8:0",
|
"src": "460:8:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_contract$_Migrations_$56",
|
"typeIdentifier": "t_contract$_Migrations_$56",
|
||||||
"typeString": "contract Migrations"
|
"typeString": "contract Migrations"
|
||||||
|
|
@ -1263,7 +1263,7 @@
|
||||||
"memberName": "setCompleted",
|
"memberName": "setCompleted",
|
||||||
"nodeType": "MemberAccess",
|
"nodeType": "MemberAccess",
|
||||||
"referencedDeclaration": 35,
|
"referencedDeclaration": 35,
|
||||||
"src": "452:21:0",
|
"src": "460:21:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
|
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
|
||||||
"typeString": "function (uint256) external"
|
"typeString": "function (uint256) external"
|
||||||
|
|
@ -1277,7 +1277,7 @@
|
||||||
"lValueRequested": false,
|
"lValueRequested": false,
|
||||||
"names": [],
|
"names": [],
|
||||||
"nodeType": "FunctionCall",
|
"nodeType": "FunctionCall",
|
||||||
"src": "452:47:0",
|
"src": "460:47:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_tuple$__$",
|
"typeIdentifier": "t_tuple$__$",
|
||||||
"typeString": "tuple()"
|
"typeString": "tuple()"
|
||||||
|
|
@ -1285,7 +1285,7 @@
|
||||||
},
|
},
|
||||||
"id": 53,
|
"id": 53,
|
||||||
"nodeType": "ExpressionStatement",
|
"nodeType": "ExpressionStatement",
|
||||||
"src": "452:47:0"
|
"src": "460:47:0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -1305,14 +1305,14 @@
|
||||||
"nodeType": "Identifier",
|
"nodeType": "Identifier",
|
||||||
"overloadedDeclarations": [],
|
"overloadedDeclarations": [],
|
||||||
"referencedDeclaration": 23,
|
"referencedDeclaration": 23,
|
||||||
"src": "384:10:0",
|
"src": "392:10:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_modifier$__$",
|
"typeIdentifier": "t_modifier$__$",
|
||||||
"typeString": "modifier ()"
|
"typeString": "modifier ()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nodeType": "ModifierInvocation",
|
"nodeType": "ModifierInvocation",
|
||||||
"src": "384:10:0"
|
"src": "392:10:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "upgrade",
|
"name": "upgrade",
|
||||||
|
|
@ -1327,7 +1327,7 @@
|
||||||
"name": "new_address",
|
"name": "new_address",
|
||||||
"nodeType": "VariableDeclaration",
|
"nodeType": "VariableDeclaration",
|
||||||
"scope": 55,
|
"scope": 55,
|
||||||
"src": "356:19:0",
|
"src": "364:19:0",
|
||||||
"stateVariable": false,
|
"stateVariable": false,
|
||||||
"storageLocation": "default",
|
"storageLocation": "default",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
|
|
@ -1338,7 +1338,7 @@
|
||||||
"id": 36,
|
"id": 36,
|
||||||
"name": "address",
|
"name": "address",
|
||||||
"nodeType": "ElementaryTypeName",
|
"nodeType": "ElementaryTypeName",
|
||||||
"src": "356:7:0",
|
"src": "364:7:0",
|
||||||
"typeDescriptions": {
|
"typeDescriptions": {
|
||||||
"typeIdentifier": "t_address",
|
"typeIdentifier": "t_address",
|
||||||
"typeString": "address"
|
"typeString": "address"
|
||||||
|
|
@ -1348,27 +1348,27 @@
|
||||||
"visibility": "internal"
|
"visibility": "internal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "355:21:0"
|
"src": "363:21:0"
|
||||||
},
|
},
|
||||||
"payable": false,
|
"payable": false,
|
||||||
"returnParameters": {
|
"returnParameters": {
|
||||||
"id": 41,
|
"id": 41,
|
||||||
"nodeType": "ParameterList",
|
"nodeType": "ParameterList",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"src": "395:0:0"
|
"src": "403:0:0"
|
||||||
},
|
},
|
||||||
"scope": 56,
|
"scope": 56,
|
||||||
"src": "339:165:0",
|
"src": "347:165:0",
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"superFunction": null,
|
"superFunction": null,
|
||||||
"visibility": "public"
|
"visibility": "public"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scope": 57,
|
"scope": 57,
|
||||||
"src": "26:480:0"
|
"src": "26:488:0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "0:507:0"
|
"src": "0:515:0"
|
||||||
},
|
},
|
||||||
"compiler": {
|
"compiler": {
|
||||||
"name": "solc",
|
"name": "solc",
|
||||||
|
|
@ -1379,7 +1379,7 @@
|
||||||
"events": {},
|
"events": {},
|
||||||
"links": {},
|
"links": {},
|
||||||
"address": "0xfaeccae8c1af6bdfd71095e1b6a2f61c61c8a7e7",
|
"address": "0xfaeccae8c1af6bdfd71095e1b6a2f61c61c8a7e7",
|
||||||
"transactionHash": "0xeee5c7819e1a662e45a8244d02305b531d2c4e11e67383dace9b458dc76f22dc"
|
"transactionHash": "0x79d68857d23437507895cbdcd033462f3a799fd1b94d51b7e624f6710cfb6c9a"
|
||||||
},
|
},
|
||||||
"1528420224459": {
|
"1528420224459": {
|
||||||
"events": {},
|
"events": {},
|
||||||
|
|
@ -1388,6 +1388,6 @@
|
||||||
"transactionHash": "0x1d1b9f147f05f37206bbfa1143bb5ec43c8a1e193d17513471b6d6f58911779c"
|
"transactionHash": "0x1d1b9f147f05f37206bbfa1143bb5ec43c8a1e193d17513471b6d6f58911779c"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schemaVersion": "2.0.0",
|
"schemaVersion": "2.0.1",
|
||||||
"updatedAt": "2018-06-08T15:58:27.900Z"
|
"updatedAt": "2018-07-06T18:05:39.259Z"
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -16,14 +16,14 @@
|
||||||
"type": "function"
|
"type": "function"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bytecode": "0x608060405234801561001057600080fd5b5060ed8061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a72305820e95f74106a3328ffadd8b0adb916d92497daab65998ee73cf40afff57dc4b29b0029",
|
"bytecode": "0x608060405234801561001057600080fd5b5060ed8061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a723058206b9724f2a2dbdc5e27a309b647c1d11903393ac90b5e54ab4925de752e5f6e760029",
|
||||||
"deployedBytecode": "0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a72305820e95f74106a3328ffadd8b0adb916d92497daab65998ee73cf40afff57dc4b29b0029",
|
"deployedBytecode": "0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a723058206b9724f2a2dbdc5e27a309b647c1d11903393ac90b5e54ab4925de752e5f6e760029",
|
||||||
"sourceMap": "26:106:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:106:2;;;;;;;",
|
"sourceMap": "26:106:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:106:2;;;;;;;",
|
||||||
"deployedSourceMap": "26:106:2:-;;;;;;;;;;;;;;;;;;;;;;;;49:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;101:5;:14;;:25;116:9;101:25;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;101:25:2;49:81;:::o",
|
"deployedSourceMap": "26:106:2:-;;;;;;;;;;;;;;;;;;;;;;;;49:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;101:5;:14;;:25;116:9;101:25;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;101:25:2;49:81;:::o",
|
||||||
"source": "pragma solidity ^0.4.19;\n\ncontract Transfers2 {\n\tfunction transfer(address _addr) public payable {\n\t\t_addr.transfer(msg.value);\n\t}\n}",
|
"source": "pragma solidity ^0.4.19;\n\ncontract Transfers2 {\n\tfunction transfer(address _addr) public payable {\n\t\t_addr.transfer(msg.value);\n\t}\n}",
|
||||||
"sourcePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
"sourcePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
||||||
"ast": {
|
"ast": {
|
||||||
"absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
"absolutePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
||||||
"exportedSymbols": {
|
"exportedSymbols": {
|
||||||
"Transfers2": [
|
"Transfers2": [
|
||||||
249
|
249
|
||||||
|
|
@ -212,7 +212,7 @@
|
||||||
"src": "0:132:2"
|
"src": "0:132:2"
|
||||||
},
|
},
|
||||||
"legacyAST": {
|
"legacyAST": {
|
||||||
"absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
"absolutePath": "/Users/dustinbrickwood/go/src/github.com/ethereum/go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol",
|
||||||
"exportedSymbols": {
|
"exportedSymbols": {
|
||||||
"Transfers2": [
|
"Transfers2": [
|
||||||
249
|
249
|
||||||
|
|
@ -409,7 +409,7 @@
|
||||||
"events": {},
|
"events": {},
|
||||||
"links": {},
|
"links": {},
|
||||||
"address": "0xa863f8203ad95e9078f6300e7857a4cca4fb4c60",
|
"address": "0xa863f8203ad95e9078f6300e7857a4cca4fb4c60",
|
||||||
"transactionHash": "0xb836110657221cb8ac728c0345ae03da1cb4313cfa0bb61285f31b780907af50"
|
"transactionHash": "0x7d4888a4f369e8b635a8418deb115db390b4ef963da86ade26feff951cf25d7c"
|
||||||
},
|
},
|
||||||
"1528420224459": {
|
"1528420224459": {
|
||||||
"events": {},
|
"events": {},
|
||||||
|
|
@ -418,6 +418,6 @@
|
||||||
"transactionHash": "0x43f3fed1df72adfe12dd0c2432f0625b4b50b0c151f9583a166722ed74786ce3"
|
"transactionHash": "0x43f3fed1df72adfe12dd0c2432f0625b4b50b0c151f9583a166722ed74786ce3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schemaVersion": "2.0.0",
|
"schemaVersion": "2.0.1",
|
||||||
"updatedAt": "2018-06-08T15:58:27.899Z"
|
"updatedAt": "2018-07-06T18:05:39.254Z"
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ contract Migrations {
|
||||||
address public owner;
|
address public owner;
|
||||||
uint public last_completed_migration;
|
uint public last_completed_migration;
|
||||||
|
|
||||||
constructor() public {
|
function Migrations() public {
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ contract Transfers {
|
||||||
Transfers2 t;
|
Transfers2 t;
|
||||||
address t_addr;
|
address t_addr;
|
||||||
|
|
||||||
constructor() public {
|
function Transfers() public {
|
||||||
t = new Transfers2();
|
t = new Transfers2();
|
||||||
t_addr = address(t);
|
t_addr = address(t);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
487
shyft-cli/web3/transfer-through-master/package-lock.json
generated
487
shyft-cli/web3/transfer-through-master/package-lock.json
generated
|
|
@ -1,5 +1,490 @@
|
||||||
{
|
{
|
||||||
"name": "transfers",
|
"name": "transfers",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 1
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||||
|
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||||
|
},
|
||||||
|
"balanced-match": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
|
},
|
||||||
|
"brace-expansion": {
|
||||||
|
"version": "1.1.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
|
"requires": {
|
||||||
|
"balanced-match": "1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"builtin-modules": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8="
|
||||||
|
},
|
||||||
|
"camelcase": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
|
||||||
|
},
|
||||||
|
"cliui": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
|
||||||
|
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
|
||||||
|
"requires": {
|
||||||
|
"string-width": "1.0.2",
|
||||||
|
"strip-ansi": "3.0.1",
|
||||||
|
"wrap-ansi": "2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"code-point-at": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||||
|
},
|
||||||
|
"concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
|
},
|
||||||
|
"decamelize": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||||
|
},
|
||||||
|
"error-ex": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||||
|
"requires": {
|
||||||
|
"is-arrayish": "0.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"find-up": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
|
||||||
|
"requires": {
|
||||||
|
"path-exists": "2.1.0",
|
||||||
|
"pinkie-promise": "2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fs-extra": {
|
||||||
|
"version": "0.30.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
|
||||||
|
"integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "4.1.11",
|
||||||
|
"jsonfile": "2.4.0",
|
||||||
|
"klaw": "1.3.1",
|
||||||
|
"path-is-absolute": "1.0.1",
|
||||||
|
"rimraf": "2.6.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fs.realpath": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
|
},
|
||||||
|
"get-caller-file": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U="
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"version": "7.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||||
|
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
||||||
|
"requires": {
|
||||||
|
"fs.realpath": "1.0.0",
|
||||||
|
"inflight": "1.0.6",
|
||||||
|
"inherits": "2.0.3",
|
||||||
|
"minimatch": "3.0.4",
|
||||||
|
"once": "1.4.0",
|
||||||
|
"path-is-absolute": "1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"graceful-fs": {
|
||||||
|
"version": "4.1.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||||
|
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
||||||
|
},
|
||||||
|
"hosted-git-info": {
|
||||||
|
"version": "2.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.1.tgz",
|
||||||
|
"integrity": "sha512-Ba4+0M4YvIDUUsprMjhVTU1yN9F2/LJSAl69ZpzaLT4l4j5mwTS6jqqW9Ojvj6lKz/veqPzpJBqGbXspOb533A=="
|
||||||
|
},
|
||||||
|
"inflight": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
|
"requires": {
|
||||||
|
"once": "1.4.0",
|
||||||
|
"wrappy": "1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||||
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||||
|
},
|
||||||
|
"invert-kv": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
|
||||||
|
},
|
||||||
|
"is-arrayish": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||||
|
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
|
||||||
|
},
|
||||||
|
"is-builtin-module": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
|
||||||
|
"requires": {
|
||||||
|
"builtin-modules": "1.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is-fullwidth-code-point": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||||
|
"requires": {
|
||||||
|
"number-is-nan": "1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is-utf8": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||||
|
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
|
||||||
|
},
|
||||||
|
"jsonfile": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||||
|
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "4.1.11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"klaw": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
|
||||||
|
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "4.1.11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lcid": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
|
||||||
|
"requires": {
|
||||||
|
"invert-kv": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"load-json-file": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "4.1.11",
|
||||||
|
"parse-json": "2.2.0",
|
||||||
|
"pify": "2.3.0",
|
||||||
|
"pinkie-promise": "2.0.1",
|
||||||
|
"strip-bom": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lodash.assign": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
||||||
|
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="
|
||||||
|
},
|
||||||
|
"memorystream": {
|
||||||
|
"version": "0.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
|
||||||
|
"integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI="
|
||||||
|
},
|
||||||
|
"minimatch": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "1.1.11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"normalize-package-data": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
|
||||||
|
"requires": {
|
||||||
|
"hosted-git-info": "2.6.1",
|
||||||
|
"is-builtin-module": "1.0.0",
|
||||||
|
"semver": "5.5.0",
|
||||||
|
"validate-npm-package-license": "3.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"number-is-nan": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||||
|
},
|
||||||
|
"once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"requires": {
|
||||||
|
"wrappy": "1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"os-locale": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
|
||||||
|
"requires": {
|
||||||
|
"lcid": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parse-json": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
|
||||||
|
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
|
||||||
|
"requires": {
|
||||||
|
"error-ex": "1.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-exists": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
|
||||||
|
"requires": {
|
||||||
|
"pinkie-promise": "2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-is-absolute": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||||
|
},
|
||||||
|
"path-type": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "4.1.11",
|
||||||
|
"pify": "2.3.0",
|
||||||
|
"pinkie-promise": "2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pify": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||||
|
},
|
||||||
|
"pinkie": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
|
||||||
|
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
|
||||||
|
},
|
||||||
|
"pinkie-promise": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
|
||||||
|
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
|
||||||
|
"requires": {
|
||||||
|
"pinkie": "2.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"read-pkg": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
|
||||||
|
"requires": {
|
||||||
|
"load-json-file": "1.1.0",
|
||||||
|
"normalize-package-data": "2.4.0",
|
||||||
|
"path-type": "1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"read-pkg-up": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
|
||||||
|
"requires": {
|
||||||
|
"find-up": "1.1.2",
|
||||||
|
"read-pkg": "1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||||
|
},
|
||||||
|
"require-from-string": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz",
|
||||||
|
"integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg="
|
||||||
|
},
|
||||||
|
"require-main-filename": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||||
|
},
|
||||||
|
"rimraf": {
|
||||||
|
"version": "2.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
|
||||||
|
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
|
||||||
|
"requires": {
|
||||||
|
"glob": "7.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "5.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||||
|
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
|
||||||
|
},
|
||||||
|
"set-blocking": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||||
|
},
|
||||||
|
"solc": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==",
|
||||||
|
"requires": {
|
||||||
|
"fs-extra": "0.30.0",
|
||||||
|
"memorystream": "0.3.1",
|
||||||
|
"require-from-string": "1.2.1",
|
||||||
|
"semver": "5.5.0",
|
||||||
|
"yargs": "4.8.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-correct": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-expression-parse": "3.0.0",
|
||||||
|
"spdx-license-ids": "3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-exceptions": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg=="
|
||||||
|
},
|
||||||
|
"spdx-expression-parse": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-exceptions": "2.1.0",
|
||||||
|
"spdx-license-ids": "3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-license-ids": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA=="
|
||||||
|
},
|
||||||
|
"string-width": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||||
|
"requires": {
|
||||||
|
"code-point-at": "1.1.0",
|
||||||
|
"is-fullwidth-code-point": "1.0.0",
|
||||||
|
"strip-ansi": "3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||||
|
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"strip-bom": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
|
||||||
|
"requires": {
|
||||||
|
"is-utf8": "0.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"validate-npm-package-license": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-correct": "3.0.0",
|
||||||
|
"spdx-expression-parse": "3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"which-module": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
|
||||||
|
},
|
||||||
|
"window-size": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz",
|
||||||
|
"integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU="
|
||||||
|
},
|
||||||
|
"wrap-ansi": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
|
||||||
|
"requires": {
|
||||||
|
"string-width": "1.0.2",
|
||||||
|
"strip-ansi": "3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
},
|
||||||
|
"y18n": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||||
|
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||||
|
},
|
||||||
|
"yargs": {
|
||||||
|
"version": "4.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
|
||||||
|
"integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=",
|
||||||
|
"requires": {
|
||||||
|
"cliui": "3.2.0",
|
||||||
|
"decamelize": "1.2.0",
|
||||||
|
"get-caller-file": "1.0.2",
|
||||||
|
"lodash.assign": "4.2.0",
|
||||||
|
"os-locale": "1.4.0",
|
||||||
|
"read-pkg-up": "1.0.1",
|
||||||
|
"require-directory": "2.1.1",
|
||||||
|
"require-main-filename": "1.0.1",
|
||||||
|
"set-blocking": "2.0.0",
|
||||||
|
"string-width": "1.0.2",
|
||||||
|
"which-module": "1.0.0",
|
||||||
|
"window-size": "0.2.0",
|
||||||
|
"y18n": "3.2.1",
|
||||||
|
"yargs-parser": "2.4.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yargs-parser": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",
|
||||||
|
"integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=",
|
||||||
|
"requires": {
|
||||||
|
"camelcase": "3.0.0",
|
||||||
|
"lodash.assign": "4.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,8 @@
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC"
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"solc": "^0.4.24"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,19 @@ var Transfers2 = artifacts.require("Transfers2");
|
||||||
contract('Transfers', function(accounts) {
|
contract('Transfers', function(accounts) {
|
||||||
var addressA = web3.eth.accounts[0];
|
var addressA = web3.eth.accounts[0];
|
||||||
var addressB = web3.eth.accounts[1];
|
var addressB = web3.eth.accounts[1];
|
||||||
|
console.log("Addr A:", addressA)
|
||||||
|
console.log("Addr B:", addressB)
|
||||||
|
|
||||||
var transfers;
|
var transfers;
|
||||||
web3.eth.defaultAccount = web3.eth.accounts[0];
|
web3.eth.defaultAccount = web3.eth.accounts[0];
|
||||||
|
|
||||||
it("should initialize", async() => {
|
it("should initialize", async() => {
|
||||||
transfers = await Transfers.new();
|
transfers = await Transfers.new();
|
||||||
transfers2 = await Transfers2.new();
|
transfers2 = await Transfers2.new();
|
||||||
assert(transfers !== undefined, "");
|
console.log("Transfer addr1", transfers.address)
|
||||||
|
console.log("Transfer addr2", transfers2.address)
|
||||||
|
|
||||||
|
assert(transfers !== undefined, "");
|
||||||
assert(transfers2 !== undefined, "");
|
assert(transfers2 !== undefined, "");
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,12 @@ package main
|
||||||
|
|
||||||
///@NOTE Shyft handler functions when endpoints are hit
|
///@NOTE Shyft handler functions when endpoints are hit
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/shyftdb"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
@ -19,13 +18,8 @@ import (
|
||||||
func GetTransaction(w http.ResponseWriter, r *http.Request) {
|
func GetTransaction(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
txHash := vars["txHash"]
|
txHash := vars["txHash"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
sqldb, err := core.DBConnection()
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
getTxResponse := core.SGetTransaction(sqldb, txHash)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
getTxResponse := shyftdb.GetTransaction(blockExplorerDb, txHash)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -40,20 +34,16 @@ func GetTransaction(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// GetAllTransactions gets txs
|
// GetAllTransactions gets txs
|
||||||
func GetAllTransactions(w http.ResponseWriter, r *http.Request) {
|
func GetAllTransactions(w http.ResponseWriter, r *http.Request) {
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
txs := shyftdb.GetAllTransactions(blockExplorerDb)
|
sqldb, err := core.DBConnection()
|
||||||
|
|
||||||
|
txs := core.SGetAllTransactions(sqldb)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
||||||
|
|
@ -64,13 +54,10 @@ func GetAllTransactions(w http.ResponseWriter, r *http.Request) {
|
||||||
func GetAllTransactionsFromBlock(w http.ResponseWriter, r *http.Request) {
|
func GetAllTransactionsFromBlock(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
blockNumber := vars["blockNumber"]
|
blockNumber := vars["blockNumber"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
txsFromBlock := shyftdb.GetAllTransactionsFromBlock(blockExplorerDb, blockNumber)
|
sqldb, err := core.DBConnection()
|
||||||
|
|
||||||
|
txsFromBlock := core.SGetAllTransactionsFromBlock(sqldb, blockNumber)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -86,13 +73,10 @@ func GetAllTransactionsFromBlock(w http.ResponseWriter, r *http.Request) {
|
||||||
func GetAllBlocksMinedByAddress(w http.ResponseWriter, r *http.Request) {
|
func GetAllBlocksMinedByAddress(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
coinbase := vars["coinbase"]
|
coinbase := vars["coinbase"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
blocksMined := shyftdb.GetAllBlocksMinedByAddress(blockExplorerDb, coinbase)
|
sqldb, err := core.DBConnection()
|
||||||
|
|
||||||
|
blocksMined := core.SGetAllBlocksMinedByAddress(sqldb, coinbase)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -109,13 +93,10 @@ func GetAllBlocksMinedByAddress(w http.ResponseWriter, r *http.Request) {
|
||||||
func GetAccount(w http.ResponseWriter, r *http.Request) {
|
func GetAccount(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
address := vars["address"]
|
address := vars["address"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
getAccountBalance := shyftdb.GetAccount(blockExplorerDb, address)
|
sqldb, err := core.DBConnection()
|
||||||
|
|
||||||
|
getAccountBalance := core.SGetAccount(sqldb, address)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -132,13 +113,10 @@ func GetAccount(w http.ResponseWriter, r *http.Request) {
|
||||||
func GetAccountTxs(w http.ResponseWriter, r *http.Request) {
|
func GetAccountTxs(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
address := vars["address"]
|
address := vars["address"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
getAccountTxs := shyftdb.GetAccountTxs(blockExplorerDb, address)
|
sqldb, err := core.DBConnection()
|
||||||
|
|
||||||
|
getAccountTxs := core.SGetAccountTxs(sqldb, address)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -153,12 +131,10 @@ func GetAccountTxs(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// GetAllAccounts gets balances
|
// GetAllAccounts gets balances
|
||||||
func GetAllAccounts(w http.ResponseWriter, r *http.Request) {
|
func GetAllAccounts(w http.ResponseWriter, r *http.Request) {
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
sqldb, err := core.DBConnection()
|
||||||
if err != nil {
|
|
||||||
return
|
allAccounts := core.SGetAllAccounts(sqldb)
|
||||||
}
|
|
||||||
allAccounts := shyftdb.GetAllAccounts(blockExplorerDb)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
|
|
@ -173,13 +149,9 @@ func GetAllAccounts(w http.ResponseWriter, r *http.Request) {
|
||||||
func GetBlock(w http.ResponseWriter, r *http.Request) {
|
func GetBlock(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
blockNumber := vars["blockNumber"]
|
blockNumber := vars["blockNumber"]
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
getBlockResponse := shyftdb.GetBlock(blockExplorerDb, blockNumber)
|
sqldb, err := core.DBConnection()
|
||||||
|
getBlockResponse := core.SGetBlock(sqldb, blockNumber)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
@ -194,12 +166,9 @@ func GetBlock(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// GetAllBlocks response
|
// GetAllBlocks response
|
||||||
func GetAllBlocks(w http.ResponseWriter, r *http.Request) {
|
func GetAllBlocks(w http.ResponseWriter, r *http.Request) {
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
sqldb, err := core.DBConnection()
|
||||||
if err != nil {
|
block3 := core.SGetAllBlocks(sqldb)
|
||||||
return
|
|
||||||
}
|
|
||||||
block3 := shyftdb.GetAllBlocks(blockExplorerDb)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
|
|
@ -210,12 +179,10 @@ func GetAllBlocks(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRecentBlock(w http.ResponseWriter, r *http.Request) {
|
func GetRecentBlock(w http.ResponseWriter, r *http.Request) {
|
||||||
connStr := "user=postgres dbname=shyftdb sslmode=disable"
|
|
||||||
blockExplorerDb, err := sql.Open("postgres", connStr)
|
sqldb, err := core.DBConnection()
|
||||||
if err != nil {
|
|
||||||
return
|
mostRecentBlock := core.SGetRecentBlock(sqldb)
|
||||||
}
|
|
||||||
mostRecentBlock := shyftdb.GetRecentBlock(blockExplorerDb)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -3,192 +3,220 @@ package shyftdb
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
"math/big"
|
"math/big"
|
||||||
//"time"
|
//"time"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBlockToReturnBlock(t *testing.T) {
|
type ShyftTracer struct {}
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
|
||||||
|
|
||||||
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
const (
|
||||||
tx1 := types.NewTransaction(1, common.BytesToAddress([]byte{0x11}), big.NewInt(111), 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
testAddress = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
|
||||||
mytx,_ := types.SignTx(tx1, signer, key)
|
)
|
||||||
tx2 := types.NewTransaction(2, common.BytesToAddress([]byte{0x22}), big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
|
||||||
mytx2,_ := types.SignTx(tx2, signer, key)
|
|
||||||
tx3 := types.NewTransaction(3, common.BytesToAddress([]byte{0x33}), big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
|
||||||
mytx3,_ := types.SignTx(tx3, signer, key)
|
|
||||||
txs := []*types.Transaction{mytx, mytx2, mytx3}
|
|
||||||
|
|
||||||
receipt := &types.Receipt{
|
func TestBlock(t *testing.T) {
|
||||||
Status: types.ReceiptStatusSuccessful,
|
eth.NewShyftTestLDB()
|
||||||
CumulativeGasUsed: 1,
|
core.InitDBTest()
|
||||||
Logs: []*types.Log{
|
shyft_tracer := new(eth.ShyftTracer)
|
||||||
{Address: common.BytesToAddress([]byte{0x11})},
|
core.SetIShyftTracer(shyft_tracer)
|
||||||
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
|
|
||||||
|
ethConf := ð.Config{
|
||||||
|
Genesis: core.DeveloperGenesisBlock(15, common.Address{}),
|
||||||
|
Etherbase: common.HexToAddress(testAddress),
|
||||||
|
Ethash: ethash.Config{
|
||||||
|
PowMode: ethash.ModeTest,
|
||||||
},
|
},
|
||||||
TxHash: common.BytesToHash([]byte{0x11, 0x11}),
|
|
||||||
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
|
|
||||||
GasUsed: 111111,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
receipts := []*types.Receipt{receipt}
|
eth.SetGlobalConfig(ethConf)
|
||||||
block := types.NewBlock(&types.Header{Number: big.NewInt(315)}, txs, nil, receipts)
|
|
||||||
|
|
||||||
// Write and verify the block in the database
|
eth.InitTracerEnv()
|
||||||
if err := WriteBlock(block, receipts); err != nil {
|
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
sqldb, err := DBConnection()
|
t.Run("TestBlockToReturnBlock", func(t *testing.T) {
|
||||||
if (err != nil) {
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
panic(err)
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
}
|
|
||||||
|
|
||||||
entry := GetBlock(sqldb, block.Number().String())
|
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
||||||
byt := []byte(entry)
|
tx1 := types.NewTransaction(1, common.BytesToAddress([]byte{0x11}), big.NewInt(111), 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
||||||
var data SBlock
|
mytx,_ := types.SignTx(tx1, signer, key)
|
||||||
json.Unmarshal(byt, &data)
|
tx2 := types.NewTransaction(2, common.BytesToAddress([]byte{0x22}), big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
||||||
|
mytx2,_ := types.SignTx(tx2, signer, key)
|
||||||
|
tx3 := types.NewTransaction(3, common.BytesToAddress([]byte{0x33}), big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
||||||
|
mytx3,_ := types.SignTx(tx3, signer, key)
|
||||||
|
txs := []*types.Transaction{mytx, mytx2, mytx3}
|
||||||
|
|
||||||
//TODO Difficulty, rewards, age
|
receipt := &types.Receipt{
|
||||||
if block.Hash().String() != data.Hash {
|
Status: types.ReceiptStatusSuccessful,
|
||||||
t.Fatalf("Block Hash [%v]: Block hash not found", block.Hash().String())
|
CumulativeGasUsed: 1,
|
||||||
}
|
Logs: []*types.Log{
|
||||||
if block.Coinbase().String() != data.Coinbase {
|
{Address: common.BytesToAddress([]byte{0x11})},
|
||||||
t.Fatalf("Block coinbase [%v]: Block coinbase not found", block.Coinbase().String())
|
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
|
||||||
}
|
},
|
||||||
if block.Number().String() != data.Number {
|
TxHash: common.BytesToHash([]byte{0x11, 0x11}),
|
||||||
t.Fatalf("Block number [%v]: Block number not found", block.Number().String())
|
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
|
||||||
}
|
GasUsed: 111111,
|
||||||
if block.GasUsed() != data.GasUsed {
|
}
|
||||||
t.Fatalf("Gas Used [%v]: Gas used not found", block.GasUsed())
|
|
||||||
}
|
|
||||||
if block.GasLimit() != data.GasLimit {
|
|
||||||
t.Fatalf("Gas Limit [%v]: Gas limit not found", block.GasLimit())
|
|
||||||
}
|
|
||||||
if block.Transactions().Len() != data.TxCount {
|
|
||||||
t.Fatalf("Tx Count [%v]: Tx Count not found", block.Transactions().Len())
|
|
||||||
}
|
|
||||||
if len(block.Uncles()) != data.UncleCount {
|
|
||||||
t.Fatalf("Uncle count [%v]: Uncle count not found", len(block.Uncles()))
|
|
||||||
}
|
|
||||||
if block.ParentHash().String() != data.ParentHash {
|
|
||||||
t.Fatalf("Parent hash [%v]: Parent hash not found", block.ParentHash().String())
|
|
||||||
}
|
|
||||||
if block.UncleHash().String() != data.UncleHash {
|
|
||||||
t.Fatalf("Uncle hash [%v]: Uncle hash not found", block.UncleHash().String())
|
|
||||||
}
|
|
||||||
if block.Size().String() != data.Size {
|
|
||||||
t.Fatalf("Size [%v]: Size not found", block.Size().String())
|
|
||||||
}
|
|
||||||
if block.Nonce() != data.Nonce {
|
|
||||||
t.Fatalf("Block nonce [%v]: Block nonce not found", block.Nonce())
|
|
||||||
}
|
|
||||||
|
|
||||||
if getAllBlocks := GetAllBlocks(sqldb); len(getAllBlocks) == 0 {
|
receipts := []*types.Receipt{receipt}
|
||||||
t.Fatalf("GetAllBlocks [%v]: GetAllBlocks did not return correctly", getAllBlocks)
|
block := types.NewBlock(&types.Header{Number: big.NewInt(315)}, txs, nil, receipts)
|
||||||
}
|
|
||||||
|
|
||||||
if getAllBlocksMinedByAddress := GetAllBlocksMinedByAddress(sqldb, block.Coinbase().String()); len(getAllBlocksMinedByAddress) == 0 {
|
|
||||||
t.Fatalf("GetAllBlocksMinedByAddress [%v]: GetAllBlocksMinedByAddress did not return correctly", getAllBlocksMinedByAddress)
|
|
||||||
}
|
|
||||||
|
|
||||||
ClearTables()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetRecentBlock(t *testing.T) {
|
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
|
||||||
|
|
||||||
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
|
||||||
tx1 := types.NewTransaction(1, common.BytesToAddress([]byte{0x11}), big.NewInt(111), 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
|
||||||
mytx,_ := types.SignTx(tx1, signer, key)
|
|
||||||
tx2 := types.NewTransaction(2, common.BytesToAddress([]byte{0x22}), big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
|
||||||
mytx2,_ := types.SignTx(tx2, signer, key)
|
|
||||||
tx3 := types.NewTransaction(3, common.BytesToAddress([]byte{0x33}), big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
|
||||||
mytx3,_ := types.SignTx(tx3, signer, key)
|
|
||||||
txs := []*types.Transaction{mytx, mytx2}
|
|
||||||
txs1 := []*types.Transaction{mytx3}
|
|
||||||
|
|
||||||
receipt1 := &types.Receipt{
|
|
||||||
Status: types.ReceiptStatusSuccessful,
|
|
||||||
CumulativeGasUsed: 1,
|
|
||||||
Logs: []*types.Log{
|
|
||||||
{Address: common.BytesToAddress([]byte{0x11})},
|
|
||||||
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
|
|
||||||
},
|
|
||||||
TxHash: common.BytesToHash([]byte{0x11, 0x11}),
|
|
||||||
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
|
|
||||||
GasUsed: 111111,
|
|
||||||
}
|
|
||||||
|
|
||||||
receipts := []*types.Receipt{receipt1}
|
|
||||||
block := types.NewBlock(&types.Header{Number: big.NewInt(322)}, txs, nil, receipts)
|
|
||||||
block2 := types.NewBlock(&types.Header{Number: big.NewInt(320)}, txs1, nil, receipts)
|
|
||||||
blocks := []*types.Block{block, block2}
|
|
||||||
|
|
||||||
for _, bc := range blocks {
|
|
||||||
// Write and verify the block in the database
|
// Write and verify the block in the database
|
||||||
if err := WriteBlock(bc, receipts); err != nil {
|
if err := core.SWriteBlock(block, receipts); err != nil {
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
sqldb, err := DBConnection()
|
sqldb, err := core.DBConnection()
|
||||||
if (err != nil) {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
response := GetRecentBlock(sqldb)
|
entry := core.SGetBlock(sqldb, block.Number().String())
|
||||||
byteRes := []byte(response)
|
byt := []byte(entry)
|
||||||
var recentBlock SBlock
|
var data core.SBlock
|
||||||
json.Unmarshal(byteRes, &recentBlock)
|
json.Unmarshal(byt, &data)
|
||||||
|
|
||||||
if block.Hash().String() != recentBlock.Hash {
|
//TODO Difficulty, rewards, age
|
||||||
t.Fatalf("Block Hash [%v]: Block hash not found", block.Hash().String())
|
if block.Hash().String() != data.Hash {
|
||||||
}
|
t.Fatalf("Block Hash [%v]: Block hash not found", block.Hash().String())
|
||||||
if block.Coinbase().String() != recentBlock.Coinbase {
|
}
|
||||||
t.Fatalf("Block coinbase [%v]: Block coinbase not found", block.Coinbase().String())
|
if block.Coinbase().String() != data.Coinbase {
|
||||||
}
|
t.Fatalf("Block coinbase [%v]: Block coinbase not found", block.Coinbase().String())
|
||||||
if block.Number().String() != recentBlock.Number {
|
}
|
||||||
t.Fatalf("Block number [%v]: Block number not found", block.Number().String())
|
if block.Number().String() != data.Number {
|
||||||
}
|
t.Fatalf("Block number [%v]: Block number not found", block.Number().String())
|
||||||
if block.GasUsed() != recentBlock.GasUsed {
|
}
|
||||||
t.Fatalf("Gas Used [%v]: Gas used not found", block.GasUsed())
|
if block.GasUsed() != data.GasUsed {
|
||||||
}
|
t.Fatalf("Gas Used [%v]: Gas used not found", block.GasUsed())
|
||||||
if block.GasLimit() != recentBlock.GasLimit {
|
}
|
||||||
t.Fatalf("Gas Limit [%v]: Gas limit not found", block.GasLimit())
|
if block.GasLimit() != data.GasLimit {
|
||||||
}
|
t.Fatalf("Gas Limit [%v]: Gas limit not found", block.GasLimit())
|
||||||
if block.Transactions().Len() != recentBlock.TxCount {
|
}
|
||||||
t.Fatalf("Tx Count [%v]: Tx Count not found", block.Transactions().Len())
|
if block.Transactions().Len() != data.TxCount {
|
||||||
}
|
t.Fatalf("Tx Count [%v]: Tx Count not found", block.Transactions().Len())
|
||||||
if len(block.Uncles()) != recentBlock.UncleCount {
|
}
|
||||||
t.Fatalf("Uncle count [%v]: Uncle count not found", len(block.Uncles()))
|
if len(block.Uncles()) != data.UncleCount {
|
||||||
}
|
t.Fatalf("Uncle count [%v]: Uncle count not found", len(block.Uncles()))
|
||||||
if block.ParentHash().String() != recentBlock.ParentHash {
|
}
|
||||||
t.Fatalf("Parent hash [%v]: Parent hash not found", block.ParentHash().String())
|
if block.ParentHash().String() != data.ParentHash {
|
||||||
}
|
t.Fatalf("Parent hash [%v]: Parent hash not found", block.ParentHash().String())
|
||||||
if block.UncleHash().String() != recentBlock.UncleHash {
|
}
|
||||||
t.Fatalf("Uncle hash [%v]: Uncle hash not found", block.UncleHash().String())
|
if block.UncleHash().String() != data.UncleHash {
|
||||||
}
|
t.Fatalf("Uncle hash [%v]: Uncle hash not found", block.UncleHash().String())
|
||||||
if block.Size().String() != recentBlock.Size {
|
}
|
||||||
t.Fatalf("Size [%v]: Size not found", block.Size().String())
|
if block.Size().String() != data.Size {
|
||||||
}
|
t.Fatalf("Size [%v]: Size not found", block.Size().String())
|
||||||
if block.Nonce() != recentBlock.Nonce {
|
}
|
||||||
t.Fatalf("Block nonce [%v]: Block nonce not found", block.Nonce())
|
if block.Nonce() != data.Nonce {
|
||||||
}
|
t.Fatalf("Block nonce [%v]: Block nonce not found", block.Nonce())
|
||||||
|
}
|
||||||
|
|
||||||
if allTxsFromBlock:= GetAllTransactionsFromBlock(sqldb, block2.Number().String()); len(allTxsFromBlock) == 0 {
|
if getAllBlocks := core.SGetAllBlocks(sqldb); len(getAllBlocks) == 0 {
|
||||||
t.Fatalf("GetAllTransactionsFromBlock [%v]: GetAllTransactionsFromBlock did not return correctly", allTxsFromBlock)
|
t.Fatalf("GetAllBlocks [%v]: GetAllBlocks did not return correctly", getAllBlocks)
|
||||||
}
|
}
|
||||||
ClearTables()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestContractCreationTx(t *testing.T) {
|
if getAllBlocksMinedByAddress := core.SGetAllBlocksMinedByAddress(sqldb, block.Coinbase().String()); len(getAllBlocksMinedByAddress) == 0 {
|
||||||
|
t.Fatalf("GetAllBlocksMinedByAddress [%v]: GetAllBlocksMinedByAddress did not return correctly", getAllBlocksMinedByAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearTables()
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("TestGetRecentBlock", func(t *testing.T) {
|
||||||
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
|
|
||||||
|
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
||||||
|
tx1 := types.NewTransaction(1, common.BytesToAddress([]byte{0x11}), big.NewInt(111), 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
||||||
|
mytx,_ := types.SignTx(tx1, signer, key)
|
||||||
|
tx2 := types.NewTransaction(2, common.BytesToAddress([]byte{0x22}), big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
||||||
|
mytx2,_ := types.SignTx(tx2, signer, key)
|
||||||
|
tx3 := types.NewTransaction(3, common.BytesToAddress([]byte{0x33}), big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
||||||
|
mytx3,_ := types.SignTx(tx3, signer, key)
|
||||||
|
txs := []*types.Transaction{mytx, mytx2}
|
||||||
|
txs1 := []*types.Transaction{mytx3}
|
||||||
|
|
||||||
|
receipt1 := &types.Receipt{
|
||||||
|
Status: types.ReceiptStatusSuccessful,
|
||||||
|
CumulativeGasUsed: 1,
|
||||||
|
Logs: []*types.Log{
|
||||||
|
{Address: common.BytesToAddress([]byte{0x11})},
|
||||||
|
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
|
||||||
|
},
|
||||||
|
TxHash: common.BytesToHash([]byte{0x11, 0x11}),
|
||||||
|
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
|
||||||
|
GasUsed: 111111,
|
||||||
|
}
|
||||||
|
|
||||||
|
receipts := []*types.Receipt{receipt1}
|
||||||
|
block := types.NewBlock(&types.Header{Number: big.NewInt(322)}, txs, nil, receipts)
|
||||||
|
block2 := types.NewBlock(&types.Header{Number: big.NewInt(320)}, txs1, nil, receipts)
|
||||||
|
blocks := []*types.Block{block, block2}
|
||||||
|
|
||||||
|
for _, bc := range blocks {
|
||||||
|
// Write and verify the block in the database
|
||||||
|
if err := core.SWriteBlock(bc, receipts); err != nil {
|
||||||
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sqldb, err := core.DBConnection()
|
||||||
|
if (err != nil) {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
response := core.SGetRecentBlock(sqldb)
|
||||||
|
byteRes := []byte(response)
|
||||||
|
var recentBlock core.SBlock
|
||||||
|
json.Unmarshal(byteRes, &recentBlock)
|
||||||
|
|
||||||
|
if block.Hash().String() != recentBlock.Hash {
|
||||||
|
t.Fatalf("Block Hash [%v]: Block hash not found", block.Hash().String())
|
||||||
|
}
|
||||||
|
if block.Coinbase().String() != recentBlock.Coinbase {
|
||||||
|
t.Fatalf("Block coinbase [%v]: Block coinbase not found", block.Coinbase().String())
|
||||||
|
}
|
||||||
|
if block.Number().String() != recentBlock.Number {
|
||||||
|
t.Fatalf("Block number [%v]: Block number not found", block.Number().String())
|
||||||
|
}
|
||||||
|
if block.GasUsed() != recentBlock.GasUsed {
|
||||||
|
t.Fatalf("Gas Used [%v]: Gas used not found", block.GasUsed())
|
||||||
|
}
|
||||||
|
if block.GasLimit() != recentBlock.GasLimit {
|
||||||
|
t.Fatalf("Gas Limit [%v]: Gas limit not found", block.GasLimit())
|
||||||
|
}
|
||||||
|
if block.Transactions().Len() != recentBlock.TxCount {
|
||||||
|
t.Fatalf("Tx Count [%v]: Tx Count not found", block.Transactions().Len())
|
||||||
|
}
|
||||||
|
if len(block.Uncles()) != recentBlock.UncleCount {
|
||||||
|
t.Fatalf("Uncle count [%v]: Uncle count not found", len(block.Uncles()))
|
||||||
|
}
|
||||||
|
if block.ParentHash().String() != recentBlock.ParentHash {
|
||||||
|
t.Fatalf("Parent hash [%v]: Parent hash not found", block.ParentHash().String())
|
||||||
|
}
|
||||||
|
if block.UncleHash().String() != recentBlock.UncleHash {
|
||||||
|
t.Fatalf("Uncle hash [%v]: Uncle hash not found", block.UncleHash().String())
|
||||||
|
}
|
||||||
|
if block.Size().String() != recentBlock.Size {
|
||||||
|
t.Fatalf("Size [%v]: Size not found", block.Size().String())
|
||||||
|
}
|
||||||
|
if block.Nonce() != recentBlock.Nonce {
|
||||||
|
t.Fatalf("Block nonce [%v]: Block nonce not found", block.Nonce())
|
||||||
|
}
|
||||||
|
|
||||||
|
if allTxsFromBlock:= core.SGetAllTransactionsFromBlock(sqldb, block2.Number().String()); len(allTxsFromBlock) == 0 {
|
||||||
|
t.Fatalf("GetAllTransactionsFromBlock [%v]: GetAllTransactionsFromBlock did not return correctly", allTxsFromBlock)
|
||||||
|
}
|
||||||
|
ClearTables()
|
||||||
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
t.Run("TestContractCreationTx", func (t *testing.T) {
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
|
|
||||||
|
|
@ -212,7 +240,7 @@ func TestContractCreationTx(t *testing.T) {
|
||||||
receipts := []*types.Receipt{receipt2}
|
receipts := []*types.Receipt{receipt2}
|
||||||
block := types.NewBlock(&types.Header{Number: big.NewInt(314)}, txs, nil, receipts)
|
block := types.NewBlock(&types.Header{Number: big.NewInt(314)}, txs, nil, receipts)
|
||||||
|
|
||||||
if err := WriteBlock(block, receipts); err != nil {
|
if err := core.SWriteBlock(block, receipts); err != nil {
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,15 +249,15 @@ func TestContractCreationTx(t *testing.T) {
|
||||||
contractAddressFromReciept = (*types.ReceiptForStorage)(receipt).ContractAddress.String()
|
contractAddressFromReciept = (*types.ReceiptForStorage)(receipt).ContractAddress.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
sqldb, err := DBConnection()
|
sqldb, err := core.DBConnection()
|
||||||
if (err != nil) {
|
if (err != nil) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
txn := GetTransaction(sqldb, tx.Hash().String())
|
txn := core.SGetTransaction(sqldb, tx.Hash().String())
|
||||||
byt := []byte(txn)
|
byt := []byte(txn)
|
||||||
var data ShyftTxEntryPretty
|
var data core.ShyftTxEntryPretty
|
||||||
json.Unmarshal(byt, &data)
|
json.Unmarshal(byt, &data)
|
||||||
|
|
||||||
if tx.Hash().String() != data.TxHash {
|
if tx.Hash().String() != data.TxHash {
|
||||||
|
|
@ -286,9 +314,9 @@ func TestContractCreationTx(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ClearTables()
|
ClearTables()
|
||||||
}
|
})
|
||||||
|
|
||||||
func TestTransactionsToReturnTransactions(t *testing.T) {
|
t.Run("TestTransactionsToReturnTransactions", func(t *testing.T) {
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
|
|
||||||
|
|
@ -316,18 +344,18 @@ func TestTransactionsToReturnTransactions(t *testing.T) {
|
||||||
receipts := []*types.Receipt{receipt1}
|
receipts := []*types.Receipt{receipt1}
|
||||||
block := types.NewBlock(&types.Header{Number: big.NewInt(314)}, txs, nil, receipts)
|
block := types.NewBlock(&types.Header{Number: big.NewInt(314)}, txs, nil, receipts)
|
||||||
|
|
||||||
if err := WriteBlock(block, receipts); err != nil {
|
if err := core.SWriteBlock(block, receipts); err != nil {
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
}
|
}
|
||||||
sqldb, err := DBConnection()
|
sqldb, err := core.DBConnection()
|
||||||
if (err != nil) {
|
if (err != nil) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
txn := GetTransaction(sqldb, tx.Hash().String())
|
txn := core.SGetTransaction(sqldb, tx.Hash().String())
|
||||||
byt := []byte(txn)
|
byt := []byte(txn)
|
||||||
var data ShyftTxEntryPretty
|
var data core.ShyftTxEntryPretty
|
||||||
json.Unmarshal(byt, &data)
|
json.Unmarshal(byt, &data)
|
||||||
|
|
||||||
//TODO age, data
|
//TODO age, data
|
||||||
|
|
@ -385,13 +413,13 @@ func TestTransactionsToReturnTransactions(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if getAllTx := GetAllTransactions(sqldb); len(getAllTx) == 0 {
|
if getAllTx := core.SGetAllTransactions(sqldb); len(getAllTx) == 0 {
|
||||||
t.Fatalf("GetAllTransactions [%v]: GetAllTransactions did not return correctly", getAllTx)
|
t.Fatalf("GetAllTransactions [%v]: GetAllTransactions did not return correctly", getAllTx)
|
||||||
}
|
}
|
||||||
ClearTables()
|
ClearTables()
|
||||||
}
|
})
|
||||||
|
|
||||||
func TestAccountsToReturnAccounts(t *testing.T) {
|
t.Run("TestAccountsToReturnAccounts",func(t *testing.T) {
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
|
|
||||||
|
|
@ -418,20 +446,19 @@ func TestAccountsToReturnAccounts(t *testing.T) {
|
||||||
|
|
||||||
receipts := []*types.Receipt{receipt1}
|
receipts := []*types.Receipt{receipt1}
|
||||||
block := types.NewBlock(&types.Header{Number: big.NewInt(315)}, txs, nil, receipts)
|
block := types.NewBlock(&types.Header{Number: big.NewInt(315)}, txs, nil, receipts)
|
||||||
if err := WriteBlock(block, receipts); err != nil {
|
if err := core.SWriteBlock(block, receipts); err != nil {
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
sqldb, err := DBConnection()
|
sqldb, err := core.DBConnection()
|
||||||
if (err != nil) {
|
if (err != nil) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
accountAddrTo := GetAccount(sqldb, tx.To().String())
|
accountAddrTo := core.SGetAccount(sqldb, tx.To().String())
|
||||||
byts := []byte(accountAddrTo)
|
byts := []byte(accountAddrTo)
|
||||||
var accountDataTo SAccounts
|
var accountDataTo core.SAccounts
|
||||||
json.Unmarshal(byts, &accountDataTo)
|
json.Unmarshal(byts, &accountDataTo)
|
||||||
|
|
||||||
if tx.To().String() != accountDataTo.Addr {
|
if tx.To().String() != accountDataTo.Addr {
|
||||||
|
|
@ -443,16 +470,17 @@ func TestAccountsToReturnAccounts(t *testing.T) {
|
||||||
if strconv.FormatUint(tx.Nonce(), 10) != accountDataTo.TxCountAccount {
|
if strconv.FormatUint(tx.Nonce(), 10) != accountDataTo.TxCountAccount {
|
||||||
t.Fatalf("To account nonce [%v]: To account nonce not found", accountDataTo.TxCountAccount)
|
t.Fatalf("To account nonce [%v]: To account nonce not found", accountDataTo.TxCountAccount)
|
||||||
}
|
}
|
||||||
if getAllAccountTxs := GetAccountTxs(sqldb, tx.To().String()); len(getAllAccountTxs) == 0 {
|
if getAllAccountTxs := core.SGetAccountTxs(sqldb, tx.To().String()); len(getAllAccountTxs) == 0 {
|
||||||
t.Fatalf("GetAccountTxs [%v]: GetAccountTxs did not return correctly", getAllAccountTxs)
|
t.Fatalf("GetAccountTxs [%v]: GetAccountTxs did not return correctly", getAllAccountTxs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if getAllAccounts := GetAllAccounts(sqldb); len(getAllAccounts) == 0 {
|
if getAllAccounts := core.SGetAllAccounts(sqldb); len(getAllAccounts) == 0 {
|
||||||
t.Fatalf("GetAllAccounts [%v]: GetAllAccounts did not return correctly", getAllAccounts)
|
t.Fatalf("GetAllAccounts [%v]: GetAllAccounts did not return correctly", getAllAccounts)
|
||||||
}
|
}
|
||||||
|
ClearTables()
|
||||||
|
})
|
||||||
|
|
||||||
ClearTables()
|
ClearTables()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
10
shyfttracerinterface/tracer_interface.go
Normal file
10
shyfttracerinterface/tracer_interface.go
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
package shyfttracerinterface
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
type IShyftTracer interface {
|
||||||
|
GetTracerToRun(hash common.Hash) (interface{}, error)
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in a new issue