Skip to content

Commit

Permalink
Updated batcher contracts to newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
glottologist committed Nov 7, 2023
1 parent 0b672f3 commit 2b73699
Show file tree
Hide file tree
Showing 55 changed files with 18,182 additions and 12,453 deletions.
101 changes: 68 additions & 33 deletions batcher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LIGO_DOCKER := docker run --rm -v $(PWD):$(PWD) -w $(PWD) ligolang/ligo:$(LIGO_

TEST_DIRECTORY:=test
STORAGE_DIRECTORY:=storage
MICHELSON_DIRECTORY:=michelson
TOKENS_DIRECTORY:=$(BATCHER_TEST_DIRECTORY)/tokens
FA12_DIRECTORY:=$(TOKENS_DIRECTORY)/fa12
FA12_STORAGE_DIRECTORY:=$(FA12_DIRECTORY)/storage
Expand All @@ -24,6 +25,11 @@ define compile_storage
$(LIGO_DOCKER) compile expression cameligo -p $(TEZOS_PROTOCOL) --michelson-format text --werror --init-file $(1) 'f()' > $(2)
endef

define build_vault
$(call compile_contract,vault.mligo, $(MICHELSON_DIRECTORY)/'$(1)-vault-$(2).tz')
$(call compile_storage,$(STORAGE_DIRECTORY)/$(1)_vault_storage_$(2).mligo, $(MICHELSON_DIRECTORY)/$(1)-vault-storage-$(2).tz)
endef

define measure_contract
$(LIGO_DOCKER) info measure-contract -p $(TEZOS_PROTOCOL) $(1)
endef
Expand All @@ -33,64 +39,93 @@ define install_deps
endef

define clean_mainnet_files
rm -rf *mainnet.tz
rm -rf $(MICHELSON_DIRECTORY)/*mainnet.tz
endef

define clean_ghostnet_files
rm -rf *ghostnet.tz
rm -rf $(MICHELSON_DIRECTORY)/*ghostnet.tz
endef

clean:
clean-mainnet:
$(call clean_mainnet_files)
clean-ghostnet:
$(call clean_ghostnet_files)
build-mainnet:
clean:
$(call clean_mainnet_files)
$(call compile_contract,batcher.mligo, batcher-mainnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/initial_storage_mainnet.mligo, batcher-storage-mainnet.tz)
build-ghostnet:
$(call clean_ghostnet_files)
$(call compile_contract,batcher.mligo, batcher-ghostnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/initial_storage_ghostnet.mligo, batcher-storage-ghostnet.tz)
build-batcher-mainnet:
$(call compile_contract,batcher.mligo, $(MICHELSON_DIRECTORY)/batcher-mainnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/batcher_storage_mainnet.mligo, $(MICHELSON_DIRECTORY)/batcher-storage-mainnet.tz)
build-batcher-ghostnet:
$(call compile_contract,batcher.mligo, $(MICHELSON_DIRECTORY)/batcher-ghostnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/batcher_storage_ghostnet.mligo, $(MICHELSON_DIRECTORY)/batcher-storage-ghostnet.tz)
build-mm-mainnet:
$(call clean_mainnet_files)
$(call compile_contract,marketmaker.mligo, marketmaker-mainnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/marketmaker_storage_mainnet.mligo, marketmaker-storage-mainnet.tz)
$(call compile_contract,marketmaker.mligo, $(MICHELSON_DIRECTORY)/marketmaker-mainnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/marketmaker_storage_mainnet.mligo, $(MICHELSON_DIRECTORY)/marketmaker-storage-mainnet.tz)
build-mm-ghostnet:
$(call clean_ghostnet_files)
$(call compile_contract,marketmaker.mligo, marketmaker-ghostnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/marketmaker_storage_ghostnet.mligo, marketmaker-storage-ghostnet.tz)
$(call compile_contract,marketmaker.mligo, $(MICHELSON_DIRECTORY)/marketmaker-ghostnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/marketmaker_storage_ghostnet.mligo, $(MICHELSON_DIRECTORY)/marketmaker-storage-ghostnet.tz)
build-tm-mainnet:
$(call compile_contract,tokenmanager.mligo, $(MICHELSON_DIRECTORY)/tokenmanager-mainnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/tokenmanager_storage_mainnet.mligo, $(MICHELSON_DIRECTORY)/tokenmanager-storage-mainnet.tz)
build-tm-ghostnet:
$(call compile_contract,tokenmanager.mligo, $(MICHELSON_DIRECTORY)/tokenmanager-ghostnet.tz)
$(call compile_storage,$(STORAGE_DIRECTORY)/tokenmanager_storage_ghostnet.mligo, $(MICHELSON_DIRECTORY)/tokenmanager-storage-ghostnet.tz)
build-tzbtc-vault-mainnet:
$(call build_vault,tzbtc,mainnet)
build-tzbtc-vault-ghostnet:
$(call build_vault,tzbtc,ghostnet)
build-btctz-vault-mainnet:
$(call build_vault,btctz,mainnet)
build-btctz-vault-ghostnet:
$(call build_vault,btctz,ghostnet)
build-eurl-vault-mainnet:
$(call build_vault,eurl,mainnet)
build-eurl-vault-ghostnet:
$(call build_vault,eurl,ghostnet)
build-usdt-vault-mainnet:
$(call build_vault,usdt,mainnet)
build-usdt-vault-ghostnet:
$(call build_vault,usdt,ghostnet)
build-usdtz-vault-mainnet:
$(call build_vault,usdtz,mainnet)
build-usdtz-vault-ghostnet:
$(call build_vault,usdtz,ghostnet)
build-tzBTC:
$(call clean_files)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, tzBTC_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/tzBTC_storage.mligo, tzBTC_token_storage.tz)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/tzBTC_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/tzBTC_storage.mligo, $(MICHELSON_DIRECTORY)/tzBTC_token_storage.tz)
build-USDT:
$(call clean_files)
$(call compile_contract,$(FA2_DIRECTORY)/main.mligo, USDT_token.tz)
$(call compile_storage,$(FA2_STORAGE_DIRECTORY)/USDT_storage.mligo, USDT_token_storage.tz)
$(call compile_contract,$(FA2_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/USDT_token.tz)
$(call compile_storage,$(FA2_STORAGE_DIRECTORY)/USDT_storage.mligo, $(MICHELSON_DIRECTORY)/USDT_token_storage.tz)
build-CTEZ:
$(call clean_files)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, CTEZ_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/CTEZ_storage.mligo, CTEZ_token_storage.tz)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/CTEZ_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/CTEZ_storage.mligo, $(MICHELSON_DIRECTORY)/CTEZ_token_storage.tz)
build-KUSD:
$(call clean_files)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, KUSD_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/KUSD_storage.mligo, KUSD_token_storage.tz)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/KUSD_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/KUSD_storage.mligo, $(MICHELSON_DIRECTORY)/KUSD_token_storage.tz)
build-EURL:
$(call clean_files)
$(call compile_contract, $(FA2_DIRECTORY)/main.mligo, EURL_token.tz)
$(call compile_storage, $(FA2_STORAGE_DIRECTORY)/EURL_storage.mligo, EURL_token_storage.tz)
$(call compile_contract, $(FA2_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/EURL_token.tz)
$(call compile_storage, $(FA2_STORAGE_DIRECTORY)/EURL_storage.mligo, $(MICHELSON_DIRECTORY)/EURL_token_storage.tz)
build-fa12-tzBTC:
$(call clean_files)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, tzBTC_fa12_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/tzBTC_storage.mligo, tzBTC_fa12_token_storage.tz)
$(call compile_contract,$(FA12_DIRECTORY)/main.mligo, $(MICHELSON_DIRECTORY)/tzBTC_fa12_token.tz)
$(call compile_storage,$(FA12_STORAGE_DIRECTORY)/tzBTC_storage.mligo, $(MICHELSON_DIRECTORY)/tzBTC_fa12_token_storage.tz)
build-all-ghostnet: build-tm-ghostnet build-tzbtc-vault-ghostnet build-eurl-vault-ghostnet build-usdt-vault-ghostnet build-btctz-vault-ghostnet build-usdtz-vault-ghostnet build-mm-ghostnet build-batcher-ghostnet
build-all-mainnet: build-tm-mainnet build-tzbtc-vault-mainnet build-eurl-vault-mainnet build-usdt-vault-mainnet build-btctz-vault-mainnet build-usdtz-vault-mainnet build-mm-mainnet build-batcher-mainnet
test-mm:
$(call test_ligo,$(TEST_DIRECTORY)/test-market-maker.mligo)
test-tm:
$(call test_ligo,$(TEST_DIRECTORY)/test-tokenmanager.mligo)
test-batcher:
$(call test_ligo,$(TEST_DIRECTORY)/test-batcher.mligo)
test-all:
$(call test_ligo,$(TEST_DIRECTORY)/test-batcher.mligo)
$(call test_ligo,$(TEST_DIRECTORY)/test-market-maker.mligo)
measure:
$(call measure_contract,batcher.mligo)
measure-mm:
$(call measure_contract,marketmaker.mligo)
measure-tm:
$(call measure_contract,tokenmanager.mligo)
install:
$(call install_deps)

Loading

0 comments on commit 2b73699

Please sign in to comment.