stellar / soroban-examples

Example Soroban Contracts
Apache License 2.0
57 stars 60 forks source link

Add basic workspace example #281

Closed leighmcculloch closed 11 months ago

leighmcculloch commented 12 months ago

What

Add basic workspace example that contains multiple contracts that are developed in close proximity to each other, and uses the native builds of the contracts, not the wasm builds, for all tests.

Why

For a long time developing for workspaces wasn't a topic we addressed because developing for a workspace of multiple contracts was no different than developing for multiple contracts at arms length.

When developing contracts at arms length the recommendation is to import those arm length dependencies as .wasm files. This has several advantages: developing against the actual dependency as it will be deployed, separating upgrades of SDK versions across contracts, source code isn't required. A significant amount of effort has gone into making this workflow smooth, so it is relatively smooth.

This example demonstrates how, using the SDK available today, it is possible to develop contracts in close proximity in a workspace where all testing is done using natively loaded contracts.

There are several advantages to this:

There are several rough edges in this workflow:

Related to https://github.com/stellar/stellar-docs/issues/481