diff --git a/Makefile b/Makefile index 519ecdb8..dcb044d5 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ PKGS=$(shell go list ./... | grep -v "/vendor/") BLUE = \033[1;34m GREEN = \033[1;32m COLOR_END = \033[0;39m +BINDING_OUTPUT_DIR=$(realpath ./internal/bindings) build: build-frontend build-backend @@ -20,6 +21,15 @@ build-frontend: # Builds the frontned application run: # Runs the application, use `make run FLAGS="--help"` @./bin/${APP_NAME} ${FLAGS} +generate-binding: + @echo "$(BLUE)Generating abi file... $(COLOR_END)" + solc --abi $(ERC20_TOKEN_FILE_PATH) -o $(BINDING_OUTPUT_DIR) + @echo "$(GREEN)ABI file generated successfully$(COLOR_END)" + @echo "$(BLUE)Generating go binding for the ERC20 token smart contarct... $(COLOR_END)" + @echo "$(shell pwd)" + abigen --abi=$(shell find $(BINDING_OUTPUT_DIR) -type f -name '*.abi') --pkg=bindings --out=$(BINDING_OUTPUT_DIR)/erc20.go + @echo "$(GREEN)Go binding generated successfully$(COLOR_END)" + test: # Runs tests @echo "Test packages" @go test -race -shuffle=on -coverprofile=coverage.out -cover $(PKGS)