aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/counter/main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/counter/main.go b/examples/counter/main.go
index 662fea1..e7961e5 100644
--- a/examples/counter/main.go
+++ b/examples/counter/main.go
@@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
+ "go/build"
"math/big"
"os"
"os/signal"
@@ -65,7 +66,11 @@ func main() {
config.Miner.ManualUncle = true
// compile the smart contract
- counterSrc, err := filepath.Abs("./counter.sol")
+ gopath := os.Getenv("GOPATH")
+ if gopath == "" {
+ gopath = build.Default.GOPATH
+ }
+ counterSrc, err := filepath.Abs(gopath + "/src/github.com/ava-labs/coreth/examples/counter/counter.sol")
checkError(err)
contracts, err := compiler.CompileSolidity("", counterSrc)
checkError(err)