forked from mantlenetworkio/mantle-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1008 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct')
VERSION := v0.0.0
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(VERSION)
LDFLAGS :=-ldflags "$(LDFLAGSSTRING)"
CONTRACTS_PATH := "../../packages/contracts-bedrock/artifacts/contracts"
gas-oracle:
env GO111MODULE=on go build -v $(LDFLAGS) -o ./bin/gas-oracle ./main.go
clean:
rm bin/gas-oracle
test:
go test -v ./...
lint:
golangci-lint run ./...
abi:
cat $(CONTRACTS_PATH)/L2/GasPriceOracle.sol/GasPriceOracle.json \
| jq '{abi,bytecode}' \
> abis/GasPriceOracle.json
binding: abi
$(eval temp := $(shell mktemp))
cat abis/GasPriceOracle.json \
| jq -r .bytecode > $(temp)
cat abis/GasPriceOracle.json \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out bindings/gaspriceoracle.go \
--type GasPriceOracle \
--bin $(temp)
rm $(temp)
.PHONY: \
gas-oracle \
clean \
test \
lint \
abi \
binding