From 3806ff396975d3507c240e1855b07495ae6c7c69 Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 9 Nov 2023 10:33:05 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{examples.yml => ci.yml} | 23 ++++++---- .github/workflows/origami.yml | 42 ------------------ Scarb.lock | 17 ++++++++ Scarb.toml | 17 +++++--- crates/Scarb.lock | 2 + crates/Scarb.toml | 10 +++++ {src => crates/src}/algebra/matrix.cairo | 0 {src => crates/src}/algebra/vec2.cairo | 0 {src => crates/src}/algebra/vector.cairo | 0 {src => crates/src}/defi/README.md | 0 {src => crates/src}/defi/auction/gda.cairo | 0 .../src}/defi/auction/helpers.cairo | 0 {src => crates/src}/defi/auction/vrgda.cairo | 0 {src => crates/src}/lib.cairo | 0 {src => crates/src}/random/deck.cairo | 0 {src => crates/src}/random/dice.cairo | 0 {src => crates/src}/security/commitment.cairo | 0 examples/Scarb.lock | 43 ------------------- examples/Scarb.toml | 13 ------ examples/market/Scarb.toml | 2 +- examples/projectile/Scarb.toml | 3 +- {examples => presets}/.gitignore | 0 {src/tokens => presets}/Scarb.lock | 0 {src/tokens => presets}/Scarb.toml | 0 .../src/erc1155/erc1155.cairo | 0 .../src/erc1155/erc1155/erc1155.cairo | 0 .../src/erc1155/erc1155/interface.cairo | 0 .../src/erc1155/erc1155/models.cairo | 0 .../src/erc1155/tests.cairo | 0 {src/tokens => presets}/src/erc20/erc20.cairo | 0 .../tokens => presets}/src/erc20/models.cairo | 0 {src/tokens => presets}/src/erc20/tests.cairo | 0 .../src/erc721/erc721.cairo | 0 .../src/erc721/models.cairo | 0 .../tokens => presets}/src/erc721/tests.cairo | 0 {src/tokens => presets}/src/lib.cairo | 0 .../src/tests/constants.cairo | 0 .../src/tests/test_erc1155.cairo | 0 .../src/tests/test_erc721.cairo | 0 {src/tokens => presets}/src/tests/utils.cairo | 0 src/tokens/.gitignore | 1 - 41 files changed, 59 insertions(+), 114 deletions(-) rename .github/workflows/{examples.yml => ci.yml} (75%) delete mode 100644 .github/workflows/origami.yml create mode 100644 crates/Scarb.lock create mode 100644 crates/Scarb.toml rename {src => crates/src}/algebra/matrix.cairo (100%) rename {src => crates/src}/algebra/vec2.cairo (100%) rename {src => crates/src}/algebra/vector.cairo (100%) rename {src => crates/src}/defi/README.md (100%) rename {src => crates/src}/defi/auction/gda.cairo (100%) rename {src => crates/src}/defi/auction/helpers.cairo (100%) rename {src => crates/src}/defi/auction/vrgda.cairo (100%) rename {src => crates/src}/lib.cairo (100%) rename {src => crates/src}/random/deck.cairo (100%) rename {src => crates/src}/random/dice.cairo (100%) rename {src => crates/src}/security/commitment.cairo (100%) delete mode 100644 examples/Scarb.lock delete mode 100644 examples/Scarb.toml rename {examples => presets}/.gitignore (100%) rename {src/tokens => presets}/Scarb.lock (100%) rename {src/tokens => presets}/Scarb.toml (100%) rename {src/tokens => presets}/src/erc1155/erc1155.cairo (100%) rename {src/tokens => presets}/src/erc1155/erc1155/erc1155.cairo (100%) rename {src/tokens => presets}/src/erc1155/erc1155/interface.cairo (100%) rename {src/tokens => presets}/src/erc1155/erc1155/models.cairo (100%) rename {src/tokens => presets}/src/erc1155/tests.cairo (100%) rename {src/tokens => presets}/src/erc20/erc20.cairo (100%) rename {src/tokens => presets}/src/erc20/models.cairo (100%) rename {src/tokens => presets}/src/erc20/tests.cairo (100%) rename {src/tokens => presets}/src/erc721/erc721.cairo (100%) rename {src/tokens => presets}/src/erc721/models.cairo (100%) rename {src/tokens => presets}/src/erc721/tests.cairo (100%) rename {src/tokens => presets}/src/lib.cairo (100%) rename {src/tokens => presets}/src/tests/constants.cairo (100%) rename {src/tokens => presets}/src/tests/test_erc1155.cairo (100%) rename {src/tokens => presets}/src/tests/test_erc721.cairo (100%) rename {src/tokens => presets}/src/tests/utils.cairo (100%) delete mode 100644 src/tokens/.gitignore diff --git a/.github/workflows/examples.yml b/.github/workflows/ci.yml similarity index 75% rename from .github/workflows/examples.yml rename to .github/workflows/ci.yml index 01f328bc..07129b22 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,10 @@ -name: Origami Examples CI +name: Origami Crates CI on: [push, pull_request] env: DOJO_VERSION: v0.3.4 SCARB_VERSION: v2.3.1 - WORKING_DIRECTORY: examples jobs: check: @@ -17,7 +16,6 @@ jobs: with: scarb-version: ${{ env.SCARB_VERSION }} - name: Format - working-directory: ${{ env.WORKING_DIRECTORY }} run: scarb fmt --check shell: bash @@ -29,30 +27,39 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Build - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo build shell: bash + origami: + needs: [check, build] + runs-on: ubuntu-latest + name: Test crates + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - name: Test + run: sozo test -f origami + shell: bash + + market: needs: [check, build] runs-on: ubuntu-latest - name: Test market + name: Test example market steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Test - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo test -f market shell: bash projectile: needs: [check, build] runs-on: ubuntu-latest - name: Test projectile + name: Test example projectile steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Test - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo test -f projectile shell: bash \ No newline at end of file diff --git a/.github/workflows/origami.yml b/.github/workflows/origami.yml deleted file mode 100644 index 6fd0beab..00000000 --- a/.github/workflows/origami.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Origami CI - -on: [push, pull_request] - -env: - DOJO_VERSION: v0.3.4 - SCARB_VERSION: v2.3.1 - -jobs: - check: - runs-on: ubuntu-latest - name: Check format - steps: - - uses: actions/checkout@v4 - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: ${{ env.SCARB_VERSION }} - - name: Format - run: scarb fmt --check - shell: bash - - build: - needs: check - runs-on: ubuntu-latest - name: Build package - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup - - name: Build - run: sozo build - shell: bash - - origami: - needs: [check, build] - runs-on: ubuntu-latest - name: Test crates - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup - - name: Test - run: sozo test - shell: bash \ No newline at end of file diff --git a/Scarb.lock b/Scarb.lock index 626ac004..b6013f24 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -18,6 +18,14 @@ dependencies = [ name = "dojo_plugin" version = "0.3.4" +[[package]] +name = "market" +version = "0.0.0" +dependencies = [ + "cubit", + "dojo", +] + [[package]] name = "origami" version = "0.0.0" @@ -25,3 +33,12 @@ dependencies = [ "cubit", "dojo", ] + +[[package]] +name = "projectile" +version = "0.0.0" +dependencies = [ + "cubit", + "dojo", + "origami", +] diff --git a/Scarb.toml b/Scarb.toml index c9e3027a..c8d95cbb 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,11 +1,18 @@ -[package] -name = "origami" +[workspace] +members = [ + "crates", + "examples/*", +] + +[workspace.package] version = "0.0.0" description = "Community-maintained libraries for Cairo" homepage = "https://github.com/dojoengine/origami" +authors = [ + "bal7hazar@proton.me", +] -[lib] - -[dependencies] +[workspace.dependencies] cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" } +origami = { path = "crates" } diff --git a/crates/Scarb.lock b/crates/Scarb.lock new file mode 100644 index 00000000..00d24f94 --- /dev/null +++ b/crates/Scarb.lock @@ -0,0 +1,2 @@ +# Code generated by scarb DO NOT EDIT. +version = 1 diff --git a/crates/Scarb.toml b/crates/Scarb.toml new file mode 100644 index 00000000..8b2cb66d --- /dev/null +++ b/crates/Scarb.toml @@ -0,0 +1,10 @@ +[package] +name = "origami" +version.workspace = true +authors.workspace = true +description.workspace = true +homepage = "https://github.com/dojoengine/origami/tree/main/crates" + +[dependencies] +cubit.workspace = true +dojo.workspace = true diff --git a/src/algebra/matrix.cairo b/crates/src/algebra/matrix.cairo similarity index 100% rename from src/algebra/matrix.cairo rename to crates/src/algebra/matrix.cairo diff --git a/src/algebra/vec2.cairo b/crates/src/algebra/vec2.cairo similarity index 100% rename from src/algebra/vec2.cairo rename to crates/src/algebra/vec2.cairo diff --git a/src/algebra/vector.cairo b/crates/src/algebra/vector.cairo similarity index 100% rename from src/algebra/vector.cairo rename to crates/src/algebra/vector.cairo diff --git a/src/defi/README.md b/crates/src/defi/README.md similarity index 100% rename from src/defi/README.md rename to crates/src/defi/README.md diff --git a/src/defi/auction/gda.cairo b/crates/src/defi/auction/gda.cairo similarity index 100% rename from src/defi/auction/gda.cairo rename to crates/src/defi/auction/gda.cairo diff --git a/src/defi/auction/helpers.cairo b/crates/src/defi/auction/helpers.cairo similarity index 100% rename from src/defi/auction/helpers.cairo rename to crates/src/defi/auction/helpers.cairo diff --git a/src/defi/auction/vrgda.cairo b/crates/src/defi/auction/vrgda.cairo similarity index 100% rename from src/defi/auction/vrgda.cairo rename to crates/src/defi/auction/vrgda.cairo diff --git a/src/lib.cairo b/crates/src/lib.cairo similarity index 100% rename from src/lib.cairo rename to crates/src/lib.cairo diff --git a/src/random/deck.cairo b/crates/src/random/deck.cairo similarity index 100% rename from src/random/deck.cairo rename to crates/src/random/deck.cairo diff --git a/src/random/dice.cairo b/crates/src/random/dice.cairo similarity index 100% rename from src/random/dice.cairo rename to crates/src/random/dice.cairo diff --git a/src/security/commitment.cairo b/crates/src/security/commitment.cairo similarity index 100% rename from src/security/commitment.cairo rename to crates/src/security/commitment.cairo diff --git a/examples/Scarb.lock b/examples/Scarb.lock deleted file mode 100644 index 0134c213..00000000 --- a/examples/Scarb.lock +++ /dev/null @@ -1,43 +0,0 @@ -# Code generated by scarb DO NOT EDIT. -version = 1 - -[[package]] -name = "cubit" -version = "1.2.0" -source = "git+https://github.com/influenceth/cubit?rev=b459053#b4590530d5aeae9aabd36740cc2a3d9e6adc5fde" - -[[package]] -name = "dojo" -version = "0.3.4" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.4#a3140d88b08b79c5ff2261c1db81bafe80b5cc91" -dependencies = [ - "dojo_plugin", -] - -[[package]] -name = "dojo_plugin" -version = "0.3.4" - -[[package]] -name = "market" -version = "0.0.0" -dependencies = [ - "cubit", - "dojo", -] - -[[package]] -name = "origami" -version = "0.0.0" -dependencies = [ - "cubit", - "dojo", -] - -[[package]] -name = "projectile" -version = "0.0.0" -dependencies = [ - "cubit", - "origami", -] diff --git a/examples/Scarb.toml b/examples/Scarb.toml deleted file mode 100644 index a49faf61..00000000 --- a/examples/Scarb.toml +++ /dev/null @@ -1,13 +0,0 @@ -[workspace] -name = "origami_examples" -version = "0.0.0" -description = "Community-maintained libraries for Cairo" -homepage = "https://github.com/dojoengine/origami" -members = [ - "market", - "projectile", -] - -[workspace.dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" } -origami = { path = "../../origami" } \ No newline at end of file diff --git a/examples/market/Scarb.toml b/examples/market/Scarb.toml index 5fc2f482..f785542e 100644 --- a/examples/market/Scarb.toml +++ b/examples/market/Scarb.toml @@ -5,5 +5,5 @@ description = "Example of defi crate usage." homepage = "https://github.com/dojoengine/origami/tree/examples/market" [dependencies] -cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } +cubit.workspace = true dojo.workspace = true \ No newline at end of file diff --git a/examples/projectile/Scarb.toml b/examples/projectile/Scarb.toml index 750a488b..295e39c4 100644 --- a/examples/projectile/Scarb.toml +++ b/examples/projectile/Scarb.toml @@ -5,5 +5,6 @@ description = "Example of algebria crate usage." homepage = "https://github.com/dojoengine/origami/tree/examples/projectile" [dependencies] -cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } +cubit.workspace = true +dojo.workspace = true origami.workspace = true \ No newline at end of file diff --git a/examples/.gitignore b/presets/.gitignore similarity index 100% rename from examples/.gitignore rename to presets/.gitignore diff --git a/src/tokens/Scarb.lock b/presets/Scarb.lock similarity index 100% rename from src/tokens/Scarb.lock rename to presets/Scarb.lock diff --git a/src/tokens/Scarb.toml b/presets/Scarb.toml similarity index 100% rename from src/tokens/Scarb.toml rename to presets/Scarb.toml diff --git a/src/tokens/src/erc1155/erc1155.cairo b/presets/src/erc1155/erc1155.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155.cairo rename to presets/src/erc1155/erc1155.cairo diff --git a/src/tokens/src/erc1155/erc1155/erc1155.cairo b/presets/src/erc1155/erc1155/erc1155.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/erc1155.cairo rename to presets/src/erc1155/erc1155/erc1155.cairo diff --git a/src/tokens/src/erc1155/erc1155/interface.cairo b/presets/src/erc1155/erc1155/interface.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/interface.cairo rename to presets/src/erc1155/erc1155/interface.cairo diff --git a/src/tokens/src/erc1155/erc1155/models.cairo b/presets/src/erc1155/erc1155/models.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/models.cairo rename to presets/src/erc1155/erc1155/models.cairo diff --git a/src/tokens/src/erc1155/tests.cairo b/presets/src/erc1155/tests.cairo similarity index 100% rename from src/tokens/src/erc1155/tests.cairo rename to presets/src/erc1155/tests.cairo diff --git a/src/tokens/src/erc20/erc20.cairo b/presets/src/erc20/erc20.cairo similarity index 100% rename from src/tokens/src/erc20/erc20.cairo rename to presets/src/erc20/erc20.cairo diff --git a/src/tokens/src/erc20/models.cairo b/presets/src/erc20/models.cairo similarity index 100% rename from src/tokens/src/erc20/models.cairo rename to presets/src/erc20/models.cairo diff --git a/src/tokens/src/erc20/tests.cairo b/presets/src/erc20/tests.cairo similarity index 100% rename from src/tokens/src/erc20/tests.cairo rename to presets/src/erc20/tests.cairo diff --git a/src/tokens/src/erc721/erc721.cairo b/presets/src/erc721/erc721.cairo similarity index 100% rename from src/tokens/src/erc721/erc721.cairo rename to presets/src/erc721/erc721.cairo diff --git a/src/tokens/src/erc721/models.cairo b/presets/src/erc721/models.cairo similarity index 100% rename from src/tokens/src/erc721/models.cairo rename to presets/src/erc721/models.cairo diff --git a/src/tokens/src/erc721/tests.cairo b/presets/src/erc721/tests.cairo similarity index 100% rename from src/tokens/src/erc721/tests.cairo rename to presets/src/erc721/tests.cairo diff --git a/src/tokens/src/lib.cairo b/presets/src/lib.cairo similarity index 100% rename from src/tokens/src/lib.cairo rename to presets/src/lib.cairo diff --git a/src/tokens/src/tests/constants.cairo b/presets/src/tests/constants.cairo similarity index 100% rename from src/tokens/src/tests/constants.cairo rename to presets/src/tests/constants.cairo diff --git a/src/tokens/src/tests/test_erc1155.cairo b/presets/src/tests/test_erc1155.cairo similarity index 100% rename from src/tokens/src/tests/test_erc1155.cairo rename to presets/src/tests/test_erc1155.cairo diff --git a/src/tokens/src/tests/test_erc721.cairo b/presets/src/tests/test_erc721.cairo similarity index 100% rename from src/tokens/src/tests/test_erc721.cairo rename to presets/src/tests/test_erc721.cairo diff --git a/src/tokens/src/tests/utils.cairo b/presets/src/tests/utils.cairo similarity index 100% rename from src/tokens/src/tests/utils.cairo rename to presets/src/tests/utils.cairo diff --git a/src/tokens/.gitignore b/src/tokens/.gitignore deleted file mode 100644 index 1de56593..00000000 --- a/src/tokens/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target \ No newline at end of file From 60a0c38c75d69fef79fa6d73ca965ecfc4476e6a Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 9 Nov 2023 10:37:32 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07129b22..f2f9401a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Origami Crates CI +name: Origami CI on: [push, pull_request] From 6afdc1d4e6d21adade39ef0c9f38a4c8e4f3cfe7 Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 9 Nov 2023 10:42:45 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20to=20dojo=20?= =?UTF-8?q?v0.3.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- Scarb.lock | 6 +++--- Scarb.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2f9401a..cea043b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Origami CI on: [push, pull_request] env: - DOJO_VERSION: v0.3.4 + DOJO_VERSION: v0.3.7 SCARB_VERSION: v2.3.1 jobs: diff --git a/Scarb.lock b/Scarb.lock index b6013f24..e34f75bd 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -8,15 +8,15 @@ source = "git+https://github.com/influenceth/cubit?rev=b459053#b4590530d5aeae9aa [[package]] name = "dojo" -version = "0.3.4" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.4#a3140d88b08b79c5ff2261c1db81bafe80b5cc91" +version = "0.3.6" +source = "git+https://github.com/dojoengine/dojo?tag=v0.3.6#08f1eba55b53de56b08221ae093a00f799fa60c1" dependencies = [ "dojo_plugin", ] [[package]] name = "dojo_plugin" -version = "0.3.4" +version = "0.3.6" [[package]] name = "market" diff --git a/Scarb.toml b/Scarb.toml index c8d95cbb..c111c3f8 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -14,5 +14,5 @@ authors = [ [workspace.dependencies] cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.6" } origami = { path = "crates" } From 640b2ac8ca26d8baa2318e193f8ed75f3317d15d Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 9 Nov 2023 10:47:39 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=92=9A=20Update=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup/action.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 23702ad0..8c289397 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ runs: using: "composite" steps: - name: Install dojoup - run: curl -L https://install.dojoengine.org | bash + run: curl -L https://install.dojoengine.org -v nightly | bash shell: bash - name: Install dojo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cea043b9..cf6fe021 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Origami CI on: [push, pull_request] env: - DOJO_VERSION: v0.3.7 + DOJO_VERSION: v0.3.6 SCARB_VERSION: v2.3.1 jobs: From 9fb986210ea7b60067b78c25d2aae2d73a8bb6ed Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 9 Nov 2023 10:49:31 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=92=9A=20Fix=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 8c289397..23702ad0 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ runs: using: "composite" steps: - name: Install dojoup - run: curl -L https://install.dojoengine.org -v nightly | bash + run: curl -L https://install.dojoengine.org | bash shell: bash - name: Install dojo