Skip to content

Commit

Permalink
feat(ioctl/ws): sync latest w3bstream contract abis and generate go c…
Browse files Browse the repository at this point in the history
  • Loading branch information
saitofun authored May 29, 2024
1 parent d0ea5ae commit 66afe7d
Show file tree
Hide file tree
Showing 14 changed files with 11,684 additions and 0 deletions.
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

0 comments on commit 66afe7d

Please sign in to comment.