AbstractSDK / templates

Templates for building Abstract modules.
10 stars 7 forks source link

How to use this template for a multi contract app? #59

Closed bbbbbbboc closed 5 months ago

bbbbbbboc commented 5 months ago

I want to have a multiple contract app with structure like this

|-- contracts
    |-- contract1
    |-- contract2
|--packages
    |-- package1

I see the carrot saving repo has this structure, how is that repo instantiated?

Buckram123 commented 5 months ago

Hey, to setup workspace from this repo all you need to do is 4 really small steps:

  1. Create contracts directory and app-name inside it
  2. Move examples/, src/ tests/ and Cargo.toml inside app-name
  3. In justfile rename cosmwasm/rust-optimizer to cosmwasm/workspace-optimizer (there are 2 arm and non-arm based)
  4. Create Cargo.toml in the root of the project with
    
    [workspace]
    members = ["contracts/*"]
    resolver = "2"

[profile.release] rpath = false lto = true overflow-checks = true opt-level = 3 debug = false debug-assertions = false codegen-units = 1 panic = 'abort' incremental = false


1 commit example: 44cd2bf
adairrr commented 5 months ago

@bbbbbbboc we've also just released a new version of the template that is a workspace. You can choose to do it with packages as well: https://github.com/AbstractSDK/app-template/releases/tag/v0.22.0-rc.1

bbbbbbboc commented 5 months ago

thanks guys, i'm already using the latest version that supports multi contracts!