Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Upgrade dojo version #86

Merged
merged 5 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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