Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ioctl][ws][#3] project sub command to support interaction with ws contracts #4281

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions ioctl/cmd/ws/contracts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.DEFAULT_GOAL := update

.PHONY: update
update: clean fetch generate_abi generate_go

.PHONY: fetch
fetch:
@echo "#### clone sprout develop branch..."
@mkdir sprout
@cd sprout && git init --quiet
@cd sprout && git remote add origin [email protected]:machinefi/sprout.git
@cd sprout && git config core.sparsecheckout true
@cd sprout && echo "smartcontracts" >> .git/info/sparse-checkout
@cd sprout && git pull origin develop --depth=1 --quiet
@echo DONE


CONTRACTS=('FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamRouter' 'W3bstreamProver')

.PHONY: generate_abi
generate_abi:
@echo "#### generate abis from latest contracts..."
@cd sprout/smartcontracts && yarn install > /dev/null 2>&1
@cd sprout/smartcontracts/contracts && for file in 'FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamRouter' 'W3bstreamProver' ; \
do \
solc --include-path ../node_modules/ --base-path . --optimize --abi --overwrite --pretty-json -o . $$file.sol > /dev/null 2>&1 ; \
if [ -e $$file.abi ]; then \
mv $$file.abi ../../../abis/$$file.json; \
fi \
done
@echo DONE

.PHONY: generate_go
generate_go:
@echo "#### generate go code by abis"
@go generate .
@echo DONE

.PHONY: clean
clean:
@rm -rf sprout

Loading
Loading