Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Jun 12, 2024
1 parent 7fc8dac commit ae15d67
Show file tree
Hide file tree
Showing 50 changed files with 13,199 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ crates/benches/bench_results.txt
**/generated
.vscode
bindings
justfile
30 changes: 25 additions & 5 deletions examples/spawn-and-move/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ dojo = { path = "../../crates/dojo-core" }
[[target.dojo]]
build-external-contracts = [ ]

[tool.dojo]
skip_migration = [
"dojo_examples::models::skipped",
"dojo_examples::skipped::skipped",
]
# `dev` profile

[tool.dojo.world]
description = "example world"
Expand All @@ -32,3 +28,27 @@ rpc_url = "http://localhost:5050/"
account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"
world_address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309"

# `release` profile
#
# for now configurations in `tool` are not merged recursively so to override
# `skip_migration` we need to redefine the whole `tool.dojo` table
[profile.release]

[profile.release.tool.dojo.world]
description = "example world"
name = "example"

[profile.release.tool.dojo.env]
rpc_url = "http://localhost:5050/"

# Default account for katana with seed = 0
account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"
world_address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309"

[profile.release.tool.dojo]
skip_migration = [
"dojo_examples::mock_token::mock_token",
"dojo_examples::models::mock_token",
]
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
{
"type": "impl",
"name": "IDojoInitImpl",
"interface_name": "dojo_examples::skipped::skipped::IDojoInit"
"interface_name": "dojo_examples::mock_token::mock_token::IDojoInit"
},
{
"type": "interface",
"name": "dojo_examples::skipped::skipped::IDojoInit",
"name": "dojo_examples::mock_token::mock_token::IDojoInit",
"items": [
{
"type": "function",
Expand Down Expand Up @@ -120,7 +120,7 @@
},
{
"type": "event",
"name": "dojo_examples::skipped::skipped::Event",
"name": "dojo_examples::mock_token::mock_token::Event",
"kind": "enum",
"variants": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,34 +319,34 @@
},
{
"type": "impl",
"name": "skippedImpl",
"interface_name": "dojo_examples::models::Iskipped"
"name": "mock_tokenImpl",
"interface_name": "dojo_examples::models::Imock_token"
},
{
"type": "struct",
"name": "dojo_examples::models::Skipped",
"name": "dojo_examples::models::MockToken",
"members": [
{
"name": "player",
"name": "account",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "value",
"type": "core::integer::u8"
"name": "amount",
"type": "core::integer::u128"
}
]
},
{
"type": "interface",
"name": "dojo_examples::models::Iskipped",
"name": "dojo_examples::models::Imock_token",
"items": [
{
"type": "function",
"name": "ensure_abi",
"inputs": [
{
"name": "model",
"type": "dojo_examples::models::Skipped"
"type": "dojo_examples::models::MockToken"
}
],
"outputs": [],
Expand All @@ -356,7 +356,7 @@
},
{
"type": "event",
"name": "dojo_examples::models::skipped::Event",
"name": "dojo_examples::models::mock_token::Event",
"kind": "enum",
"variants": []
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[
{
"type": "impl",
"name": "DojoResourceProviderImpl",
"interface_name": "dojo::world::IDojoResourceProvider"
},
{
"type": "interface",
"name": "dojo::world::IDojoResourceProvider",
"items": [
{
"type": "function",
"name": "dojo_resource",
"inputs": [],
"outputs": [
{
"type": "core::felt252"
}
],
"state_mutability": "view"
}
]
},
{
"type": "impl",
"name": "WorldProviderImpl",
"interface_name": "dojo::world::IWorldProvider"
},
{
"type": "struct",
"name": "dojo::world::IWorldDispatcher",
"members": [
{
"name": "contract_address",
"type": "core::starknet::contract_address::ContractAddress"
}
]
},
{
"type": "interface",
"name": "dojo::world::IWorldProvider",
"items": [
{
"type": "function",
"name": "world",
"inputs": [],
"outputs": [
{
"type": "dojo::world::IWorldDispatcher"
}
],
"state_mutability": "view"
}
]
},
{
"type": "impl",
"name": "IDojoInitImpl",
"interface_name": "dojo_examples::mock_token::mock_token::IDojoInit"
},
{
"type": "interface",
"name": "dojo_examples::mock_token::mock_token::IDojoInit",
"items": [
{
"type": "function",
"name": "dojo_init",
"inputs": [],
"outputs": [],
"state_mutability": "view"
}
]
},
{
"type": "impl",
"name": "UpgradableImpl",
"interface_name": "dojo::components::upgradeable::IUpgradeable"
},
{
"type": "interface",
"name": "dojo::components::upgradeable::IUpgradeable",
"items": [
{
"type": "function",
"name": "upgrade",
"inputs": [
{
"name": "new_class_hash",
"type": "core::starknet::class_hash::ClassHash"
}
],
"outputs": [],
"state_mutability": "external"
}
]
},
{
"type": "event",
"name": "dojo::components::upgradeable::upgradeable::Upgraded",
"kind": "struct",
"members": [
{
"name": "class_hash",
"type": "core::starknet::class_hash::ClassHash",
"kind": "data"
}
]
},
{
"type": "event",
"name": "dojo::components::upgradeable::upgradeable::Event",
"kind": "enum",
"variants": [
{
"name": "Upgraded",
"type": "dojo::components::upgradeable::upgradeable::Upgraded",
"kind": "nested"
}
]
},
{
"type": "event",
"name": "dojo_examples::mock_token::mock_token::Event",
"kind": "enum",
"variants": [
{
"name": "UpgradeableEvent",
"type": "dojo::components::upgradeable::upgradeable::Event",
"kind": "nested"
}
]
}
]
Loading

0 comments on commit ae15d67

Please sign in to comment.