Closed mubarak23 closed 4 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
joyboy | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 6, 2024 11:06am |
joyboy-webapp | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 6, 2024 11:06am |
am getting the following error
Unexpected argument type. Expected: "core::array::Array::<core::felt252>", found: "core::array::Span::<core::felt252>".
on this line
return self.is_valid_signature(tx_hash, signature);
for signature
field
warning: Plugin diagnostic: Failed to generate ABI: __execute__
is a reserved entry point names for account contracts only.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:77:5
#[external(v0)]
^*************^
error: Method is_zero
not found on type core::starknet::contract_address::ContractAddress
. Did you import the correct trait and impl?
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:81:27
assert(sender.is_zero(), 'Account: invalid caller');
^*****^
error: Item core::starknet::call_contract_syscall
is not visible in this context.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:95:46
let _res = starknet::call_contract_syscall(to, selector, calldata.span())
^*******************^
error: Method span
could not be called on type core::array::Span::<core::felt252>
.
Candidate ArrayTrait::span
inference failed with: Type mismatch: core::array::Span::<core::felt252>
and @core::array::Array::<?7>
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:95:91
let _res = starknet::call_contract_syscall(to, selector, calldata.span())
^**^
error: Unexpected argument type. Expected: "core::array::Array::
"core::array::Span::<core::felt252>".
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:109:53
return self.is_valid_signature(tx_hash, signature);
^*******^
error: Function not found.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:119:30
let byte_array = format_as_byte_array(hash, 16);
^******************^
error: Identifier not found.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:121:36
let verify_signature = bip340::verify(
^****^
warning: Unused variable. Consider ignoring by prefixing with _
.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:117:17
let public_key = self.public_key.read();
^********^
warning: Unused variable. Consider ignoring by prefixing with _
.
--> /home/runner/work/joyboy/joyboy/onchain/src/social/account.cairo:119:17
let byte_array = format_as_byte_array(hash, 16);
^********^
Did you manage to fix compilation errors?
Did you manage to fix compilation errors?
no,
call to this function,
return self.is_valid_signature(tx_hash, signature);
signature
throw this error
core::array::Span::
Unexpected argument type. Expected: "core::array::Array::
Please check if this will help: https://github.com/OpenZeppelin/cairo-contracts/blob/978b4e75209da355667d8954d2450e32bd71fe49/src/account/account.cairo#L282
![]()
Please check if this will help: https://github.com/OpenZeppelin/cairo-contracts/blob/978b4e75209da355667d8954d2450e32bd71fe49/src/account/account.cairo#L282
i understand their implementation,
it a bit different from my own,
from
__validate__
am passing signature of type
core::array::Span::<core::felt252>
into
is_valid_signature
fn is_valid_signature(
self: @ContractState, hash: felt252, signature: Array<felt252>
) -> felt252 {}
is_valid_signature expect a type
core::array::Array::<core::felt252>
how do i convert signature of type
core::array::Span::<core::felt252>
to core::array::Array::<core::felt252>
before passing it into is_valid_signature function
from this warning error
warn: Plugin diagnostic: Failed to generate ABI:
executeis a reserved entry point names for account contracts only.
Does this mean we cannot use execute as function name
Please let me know what is the status of this pr. Do you intend to complete it?
Please let me know what is the status of this pr. Do you intend to complete it?
Yes,
We will restart the work in another pr.
This is a draft PR for snip-6 for SocialPay account contract implementation,
hash: felt252, signature: Array<felt252>
, how can use this argument to formbip340::verify
function argument.bip340::verify(public_key, *social_event.sig.r, *social_event.sig.s, ba)
from what am seeing here, i need to collect event message in order to achieve these function argument.
does this make sense to push this into the constructor,
am not sure if this will work since SocialRequest will keep changing base on the event that was send.