OpenZeppelin / cairo-contracts

OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup
https://docs.openzeppelin.com/contracts-cairo
MIT License
797 stars 322 forks source link

Bug: Wrong call and etiquette for SCRI6 #887

Closed machuwey closed 5 months ago

machuwey commented 5 months ago

📝 Details

Hello guys, I'm was trying to integrate and play around wit OZs cairo library, for my surprise when I went to execute scab build the following errors popped up:

@machuwey ➜ /workspaces/cairo-contracts (main) $ scarb build
Compiling lib(openzeppelin) openzeppelin v0.8.1 (/workspaces/cairo-contracts/Scarb.toml)
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::<?0>`
--> /workspaces/cairo-contracts/src/account/utils.cairo:31:60
starknet::call_contract_syscall(to, selector, calldata.span()).unwrap()
^**^

warn: Plugin diagnostic: Failed to generate ABI: `__execute__` is a reserved entry point names for account contracts only.
--> /workspaces/cairo-contracts/src/presets/account.cairo:16:5
#[abi(embed_v0)]
^**************^

warn: Plugin diagnostic: The 'external' attribute on impls is deprecated. Use 'abi(per_item)' or 'abi(embed_v0)'.
--> /workspaces/cairo-contracts/src/presets/eth_account.cairo:71:5
#[external(v0)]
^*************^

warn: Plugin diagnostic: Failed to generate ABI: `__execute__` is a reserved entry point names for account contracts only.
--> /workspaces/cairo-contracts/src/presets/eth_account.cairo:23:5
#[abi(embed_v0)]
^**************^

error: could not compile `openzeppelin` due to previous error

🔢 Code to reproduce bug

Just scarb build the project itself or add it as a dependecy to another and execute scarb build

martriay commented 5 months ago

Closing as duplicate of #871