forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 1006 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
SHELL := /bin/bash
GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct')
GITVERSION := $(shell cat package.json | jq .version)
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
LDFLAGS :=-ldflags "$(LDFLAGSSTRING)"
CONTRACTS_PATH := "../../packages/contracts/artifacts/contracts"
gas-oracle:
env GO111MODULE=on go build $(LDFLAGS)
.PHONY: gas-oracle
clean:
rm gas-oracle
test:
go test -v ./...
lint:
golangci-lint run ./...
abi:
cat $(CONTRACTS_PATH)/L2/predeploys/OVM_GasPriceOracle.sol/OVM_GasPriceOracle.json \
| jq '{abi,bytecode}' \
> abis/OVM_GasPriceOracle.json
binding: abi
$(eval temp := $(shell mktemp))
cat abis/OVM_GasPriceOracle.json \
| jq -r .bytecode > $(temp)
cat abis/OVM_GasPriceOracle.json \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out bindings/gaspriceoracle.go \
--type GasPriceOracle \
--bin $(temp)
rm $(temp)