aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/evm/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/evm/main.go')
-rw-r--r--cmd/evm/main.go25
1 files changed, 13 insertions, 12 deletions
diff --git a/cmd/evm/main.go b/cmd/evm/main.go
index 86e2493ca..a489efbfc 100644
--- a/cmd/evm/main.go
+++ b/cmd/evm/main.go
@@ -20,6 +20,7 @@ package main
import (
"fmt"
"io/ioutil"
+ "math/big"
"os"
goruntime "runtime"
"time"
@@ -51,20 +52,20 @@ var (
Name: "codefile",
Usage: "file containing EVM code",
}
- GasFlag = cli.StringFlag{
+ GasFlag = cli.Uint64Flag{
Name: "gas",
Usage: "gas limit for the evm",
- Value: "10000000000",
+ Value: 10000000000,
}
- PriceFlag = cli.StringFlag{
+ PriceFlag = utils.BigFlag{
Name: "price",
Usage: "price set for the evm",
- Value: "0",
+ Value: new(big.Int),
}
- ValueFlag = cli.StringFlag{
+ ValueFlag = utils.BigFlag{
Name: "value",
Usage: "value set for the evm",
- Value: "0",
+ Value: new(big.Int),
}
DumpFlag = cli.BoolFlag{
Name: "dump",
@@ -160,9 +161,9 @@ func run(ctx *cli.Context) error {
ret, _, err = runtime.Create(input, &runtime.Config{
Origin: sender.Address(),
State: statedb,
- GasLimit: common.Big(ctx.GlobalString(GasFlag.Name)).Uint64(),
- GasPrice: common.Big(ctx.GlobalString(PriceFlag.Name)),
- Value: common.Big(ctx.GlobalString(ValueFlag.Name)),
+ GasLimit: ctx.GlobalUint64(GasFlag.Name),
+ GasPrice: utils.GlobalBig(ctx, PriceFlag.Name),
+ Value: utils.GlobalBig(ctx, ValueFlag.Name),
EVMConfig: vm.Config{
Tracer: logger,
Debug: ctx.GlobalBool(DebugFlag.Name),
@@ -177,9 +178,9 @@ func run(ctx *cli.Context) error {
ret, err = runtime.Call(receiverAddress, common.Hex2Bytes(ctx.GlobalString(InputFlag.Name)), &runtime.Config{
Origin: sender.Address(),
State: statedb,
- GasLimit: common.Big(ctx.GlobalString(GasFlag.Name)).Uint64(),
- GasPrice: common.Big(ctx.GlobalString(PriceFlag.Name)),
- Value: common.Big(ctx.GlobalString(ValueFlag.Name)),
+ GasLimit: ctx.GlobalUint64(GasFlag.Name),
+ GasPrice: utils.GlobalBig(ctx, PriceFlag.Name),
+ Value: utils.GlobalBig(ctx, ValueFlag.Name),
EVMConfig: vm.Config{
Tracer: logger,
Debug: ctx.GlobalBool(DebugFlag.Name),