Skip to content
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 dojo.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ struct Resultbool wait_for_transaction(struct Provider *rpc, struct FieldElement

struct FieldElement hash_get_contract_address(struct FieldElement class_hash,
struct FieldElement salt,
const Felt *constructor_calldata,
const struct FieldElement *constructor_calldata,
uintptr_t constructor_calldata_len,
struct FieldElement deployer_address);

Expand Down
2 changes: 1 addition & 1 deletion dojo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ Result<bool> wait_for_transaction(Provider *rpc, FieldElement txn_hash);

FieldElement hash_get_contract_address(FieldElement class_hash,
FieldElement salt,
const Felt *constructor_calldata,
const FieldElement *constructor_calldata,
uintptr_t constructor_calldata_len,
FieldElement deployer_address);

Expand Down
6 changes: 5 additions & 1 deletion src/c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ pub unsafe extern "C" fn wait_for_transaction(
pub unsafe extern "C" fn hash_get_contract_address(
class_hash: types::FieldElement,
salt: types::FieldElement,
constructor_calldata: *const Felt,
constructor_calldata: *const types::FieldElement,
constructor_calldata_len: usize,
deployer_address: types::FieldElement,
) -> types::FieldElement {
Expand All @@ -662,6 +662,10 @@ pub unsafe extern "C" fn hash_get_contract_address(
let constructor_calldata = unsafe {
std::slice::from_raw_parts(constructor_calldata, constructor_calldata_len).to_vec()
};
let constructor_calldata = constructor_calldata
.iter()
.map(|f| (&f.clone()).into())
.collect::<Vec<Felt>>();
let deployer_address = (&deployer_address).into();

let address = get_contract_address(salt, class_hash, &constructor_calldata, deployer_address);
Expand Down