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

feat: use of WorldContractReader from abigen! #1010

Merged
merged 18 commits into from
Dec 20, 2023
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
48 changes: 48 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/dojo-core/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.4.0
1 change: 1 addition & 0 deletions crates/dojo-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ starknet.workspace = true
thiserror.workspace = true
tracing.workspace = true

cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.1.7", features = ["abigen-rs"] }
dojo-types = { path = "../dojo-types", optional = true }
http = { version = "0.2.9", optional = true }
ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls" ], optional = true }
Expand Down
13 changes: 13 additions & 0 deletions crates/dojo-world/src/contracts/abi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Embedded ABI for contracts

Currently, the ABIs for `world` and `executor` are embedded in the repo.
To build them, consider the following:

1. Change directory into `examples/spawn-and-move` at the root of the workspace.
2. Build the example with `sozo`.
3. Extract the ABI key only for `world` and `executor`:
```
sozo build
jq .abi ./target/dev/dojo\:\:world\:\:world.json > ../../crates/dojo-world/src/contracts/abi/world.json
jq .abi ./target/dev/dojo\:\:executor\:\:executor.json > ../../crates/dojo-world/src/contracts/abi/executor.json
```
53 changes: 53 additions & 0 deletions crates/dojo-world/src/contracts/abi/executor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[
{
"type": "impl",
"name": "Executor",
"interface_name": "dojo::executor::IExecutor"
},
{
"type": "struct",
"name": "core::array::Span::<core::felt252>",
"members": [
{
"name": "snapshot",
"type": "@core::array::Array::<core::felt252>"
}
]
},
{
"type": "interface",
"name": "dojo::executor::IExecutor",
"items": [
{
"type": "function",
"name": "call",
"inputs": [
{
"name": "class_hash",
"type": "core::starknet::class_hash::ClassHash"
},
{
"name": "entrypoint",
"type": "core::felt252"
},
{
"name": "calldata",
"type": "core::array::Span::<core::felt252>"
}
],
"outputs": [
{
"type": "core::array::Span::<core::felt252>"
}
],
"state_mutability": "view"
}
]
},
{
"type": "event",
"name": "dojo::executor::executor::Event",
"kind": "enum",
"variants": []
}
]
Loading
Loading