Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 2.48 KB

File metadata and controls

80 lines (59 loc) · 2.48 KB

SO4.market Make Workflows

The root Makefile includes the files in this directory. Keep routine operator commands here instead of growing a single large Makefile.

Build and test

make check
make lint
make test
make build
make test-one PACKAGE=deposit-handler

Deploy

make deploy-all NETWORK=testnet SOURCE=alice
make deploy-contract CONTRACT=reader NETWORK=testnet SOURCE=alice
make deploy-mainnet SOURCE=deployer
make addresses NETWORK=testnet

Full deployments write addresses to .deployed/<network>.env. If that file already exists, make deploy-all stops and prints upgrade commands so you do not accidentally create a second protocol deployment. To intentionally redeploy everything, use:

make deploy-force NETWORK=testnet SOURCE=alice

deploy-contract is for standalone debugging. It deploys one Wasm and prints the new address, but it does not update .deployed/<network>.env or wire the contract into the protocol graph.

Upgrade

Upgrades are a two-step Soroban flow:

  1. Upload the new Wasm and get a BytesN<32> Wasm hash.
  2. Invoke upgrade --new_wasm_hash <hash> on the existing contract address.

The contract address stays the same. The deployed contract must already expose an admin-gated upgrade(env, new_wasm_hash) function that calls env.deployer().update_current_contract_wasm(new_wasm_hash).

make upgrade-contract CONTRACT=deposit_handler NETWORK=testnet SOURCE=alice
make upgrade-all NETWORK=testnet SOURCE=alice
make upload CONTRACT=deposit_handler NETWORK=testnet SOURCE=alice
make upgrade-with-hash CONTRACT_ID=C... WASM_HASH=... NETWORK=testnet SOURCE=alice

upgrade-all upgrades every deployed contract listed in UPGRADE_CONTRACTS. Every listed contract must already expose the admin-gated upgrade entrypoint.

Test Tokens

Use Stellar Asset Contracts for test assets such as test WBTC. A Stellar asset is identified by CODE:ISSUER, and its SAC gives your contracts a normal SEP-41 token address.

make token-bootstrap CODE=TWBTC TO=alice NETWORK=testnet SOURCE=alice
make token-bootstrap CODE=TUSDC TO=alice NETWORK=testnet SOURCE=alice
make tokens NETWORK=testnet

Amounts are raw 7-decimal units for this protocol. For example:

make token-mint CODE=TWBTC TO=alice AMOUNT=100000000 NETWORK=testnet SOURCE=alice

That mints 10.0000000 TWBTC.

For mainnet, do not use token-bootstrap for real assets. Deploy or look up the existing SAC for the real Stellar asset and configure markets with that address.