Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamer committed Apr 11, 2024
1 parent b27c60c commit cd34671
Show file tree
Hide file tree
Showing 13 changed files with 8,344 additions and 2,214 deletions.
38 changes: 37 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ distclean: clean
### Protobuf ###
###############################################################################

protoVer=0.11.2
protoVer=0.13.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

Expand Down Expand Up @@ -120,3 +120,39 @@ format:

benchmark:
@go test -mod=readonly -bench=. ./...



###############################################################################
### Compile Solidity Contracts ###
###############################################################################

CONTRACTS_DIR := contracts
COMPILED_DIR := $(CONTRACTS_DIR)/compiled_contracts

# Compile and format solidity contracts for the erc20 module. Also install
# openzeppeling as the contracts are build on top of openzeppelin templates.
contracts-compile: contracts-clean dep-install create-contracts-abi contracts-clean

# Install openzeppelin solidity contracts
dep-install:
@echo "Importing openzeppelin contracts..."
@cd $(CONTRACTS_DIR) && \
npm install

# Clean tmp files
contracts-clean:
@rm -rf $(CONTRACTS_DIR)/node_modules

# Compile, filter out and format contracts into the following format.
# {
# "abi": "[{\"inpu # JSON string
# "bin": "60806040
# "contractName": # filename without .sol
# }
create-contracts-abi:
solc --combined-json abi,bin --evm-version paris --include-path $(CONTRACTS_DIR)/node_modules --base-path ./contracts ./contracts/Token.sol | jq '.contracts["Token.sol:Token"]' > $(COMPILED_DIR)/Token.json

###############################################################################
### Miscellaneous Checks ###
###############################################################################
Loading

0 comments on commit cd34671

Please sign in to comment.