Skip to content

Commit

Permalink
⬆️ Upgrade dojo version (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar authored Aug 9, 2024
1 parent 229d36a commit b3aac3e
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
DOJO_VERSION: v1.0.0-alpha.3
DOJO_VERSION: v1.0.0-alpha.4
SCARB_VERSION: 2.7.0-rc.4

jobs:
Expand Down
18 changes: 9 additions & 9 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source = "git+https://github.com/dojoengine/cubit?branch=cairo_2.7#53020b6320a10
[[package]]
name = "dojo"
version = "0.7.3"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.3#a6a7724380169372336e886fb36f31f56e7d0d8a"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.4#d08c46191fc1b4c4f90816cef4787cb8db02988f"
dependencies = [
"dojo_plugin",
]
Expand All @@ -21,44 +21,44 @@ source = "git+https://github.com/dojoengine/dojo?rev=71b1f1a4#71b1f1a467534cbeeb

[[package]]
name = "origami_algebra"
version = "0.1.0"
version = "1.0.0-alpha.4"
dependencies = [
"cubit",
]

[[package]]
name = "origami_defi"
version = "0.1.0"
version = "1.0.0-alpha.4"
dependencies = [
"cubit",
]

[[package]]
name = "origami_governance"
version = "1.0.0-alpha.0"
version = "1.0.0-alpha.4"
dependencies = [
"dojo",
]

[[package]]
name = "origami_map"
version = "0.1.0"
version = "1.0.0-alpha.4"

[[package]]
name = "origami_random"
version = "0.1.0"
version = "1.0.0-alpha.4"

[[package]]
name = "origami_rating"
version = "0.1.0"
version = "1.0.0-alpha.4"

[[package]]
name = "origami_security"
version = "0.1.0"
version = "1.0.0-alpha.4"

[[package]]
name = "origami_token"
version = "1.0.0-alpha.0"
version = "1.0.0-alpha.4"
dependencies = [
"dojo",
]
7 changes: 5 additions & 2 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ members = [
"crates/rating",
"crates/security",
"crates/token",
"crates/governance"
"crates/governance",
]

[workspace.package]
version = "1.0.0-alpha.4"

[workspace.dependencies]
cubit = { git = "https://github.com/dojoengine/cubit", branch = "cairo_2.7" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.3" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.4" }
starknet = "2.7.0-rc.3"

# Scripts are not supported for virtual workspaces.
2 changes: 1 addition & 1 deletion crates/algebra/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_algebra"
version = "0.1.0"
version.workspace = true
description = "Algebra library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/algebra"

Expand Down
2 changes: 1 addition & 1 deletion crates/defi/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_defi"
version = "0.1.0"
version.workspace = true
description = "DeFi library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/defi"
edition = "2024_07"
Expand Down
2 changes: 1 addition & 1 deletion crates/governance/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_governance"
version = "1.0.0-alpha.0"
version.workspace = true
description = "Implementations of Compound Governance standards for the Dojo framework."
homepage = "https://github.com/dojoengine/origami/tree/governance"

Expand Down
2 changes: 1 addition & 1 deletion crates/map/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_map"
version = "0.1.0"
version.workspace = true
description = "Maps library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/map"
edition = "2024_07"
Expand Down
3 changes: 1 addition & 2 deletions crates/random/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[package]
name = "origami_random"
version = "0.1.0"
version.workspace = true
description = "Random generator library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/random"
edition = "2024_07"

[dependencies]

2 changes: 1 addition & 1 deletion crates/rating/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_rating"
version = "0.1.0"
version.workspace = true
description = "Rating related algorithm library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/rating"
edition = "2024_07"
Expand Down
2 changes: 1 addition & 1 deletion crates/security/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_security"
version = "0.1.0"
version.workspace = true
description = "Security library for Dojo based games."
homepage = "https://github.com/dojoengine/origami/tree/main/crates/security"
edition = "2024_07"
Expand Down
2 changes: 1 addition & 1 deletion crates/token/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origami_token"
version = "1.0.0-alpha.0"
version.workspace = true
description = "Implementations of ERC standards for the Dojo framework."
homepage = "https://github.com/dojoengine/origami/tree/crates/token"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ mod erc20_bridgeable_mock {
l2_bridge_address: ContractAddress,
) {
assert(
self.world().is_owner(get_caller_address(), self.selector()),
self.world().is_owner(self.selector(), get_caller_address()),
Errors::CALLER_IS_NOT_OWNER
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn STATE() -> (IWorldDispatcher, erc20_bridgeable_mock::ContractState) {
state.world_dispatcher.write(world);

world
.grant_owner(starknet::get_contract_address(), dojo::contract::IContract::selector(@state));
.grant_owner(dojo::contract::IContract::selector(@state), starknet::get_contract_address());

(world, state)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/token/src/presets/erc20/bridgeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ mod ERC20Bridgeable {
l2_bridge_address: ContractAddress,
) {
assert(
self.world().is_owner(get_caller_address(), self.selector()),
self.world().is_owner(self.selector(), get_caller_address()),
Errors::CALLER_IS_NOT_OWNER
);

Expand Down
8 changes: 4 additions & 4 deletions crates/token/src/presets/erc20/tests_bridgeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ fn setup() -> (IWorldDispatcher, IERC20BridgeablePresetDispatcher) {

world
.grant_owner(
starknet::get_contract_address(), dojo::utils::bytearray_hash(@"origami_token")
dojo::utils::bytearray_hash(@"origami_token"), starknet::get_contract_address()
);
world.grant_owner(OWNER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(BRIDGE(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(SPENDER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), OWNER());
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), BRIDGE());
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), SPENDER());

// initialize contracts
erc20_bridgeable_dispatcher.initializer("NAME", "SYMBOL", SUPPLY, OWNER(), BRIDGE());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ mod ERC721EnumMintBurn {
token_ids: Span<u256>
) {
assert(
self.world().is_owner(get_caller_address(), self.selector()),
self.world().is_owner(self.selector(), get_caller_address()),
Errors::CALLER_IS_NOT_OWNER
);

Expand Down
2 changes: 1 addition & 1 deletion crates/token/src/presets/erc721/mintable_burnable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod ERC721MintableBurnable {
token_ids: Span<u256>
) {
assert(
self.world().is_owner(get_caller_address(), self.selector()),
self.world().is_owner(self.selector(), get_caller_address()),
Errors::CALLER_IS_NOT_OWNER
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ fn setup_uninitialized() -> (IWorldDispatcher, IERC721EnumMintBurnPresetDispatch

world
.grant_owner(
starknet::get_contract_address(), dojo::utils::bytearray_hash(@"origami_token")
dojo::utils::bytearray_hash(@"origami_token"), starknet::get_contract_address()
);
world.grant_owner(OWNER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(SPENDER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), OWNER());
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), SPENDER());

(world, erc721_enum_mint_burn_dispatcher)
}
Expand Down
6 changes: 3 additions & 3 deletions crates/token/src/presets/erc721/tests_mintable_burnable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ fn setup_uninitialized() -> (IWorldDispatcher, IERC721MintableBurnablePresetDisp

world
.grant_owner(
starknet::get_contract_address(), dojo::utils::bytearray_hash(@"origami_token")
dojo::utils::bytearray_hash(@"origami_token"), starknet::get_contract_address()
);
world.grant_owner(OWNER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(SPENDER(), dojo::utils::bytearray_hash(@"origami_token"));
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), OWNER());
world.grant_owner(dojo::utils::bytearray_hash(@"origami_token"), SPENDER());

(world, erc721_mintable_burnable_dispatcher)
}
Expand Down

0 comments on commit b3aac3e

Please sign in to comment.