question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need `--account-contract` flag when importing `IAccount`

See original GitHub issue

IAccount exopses the __execute__ function which gets the cairo-compiler to yell and error like this:

Only account contracts may have a function named "__execute__". Use --account-contract flag.

        Failed

Unfortunately this means I can’t write a contract that includes IAccount without adding the --account-contract flag (which is plain wrong because I’m NOT writing an account contract but simply interacting with one!).

Not sure OZ can do anything about it, I think we need to address this to the StarkWare team but just putting it out there 😃

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ilyalesokhin-starkwarecommented, May 26, 2022

This is related to the #291 and it’s already fixed in the main branch of openzeppelin-cairo-contracts.

openzeppelin-cairo-contracts v0.1.0 is broken.

1reaction
martriaycommented, May 26, 2022

All right so I guess problem solved! So I guess you testing with a local clone of the OZ repo?

@martriay @andrew-fleming do you think OZ could issue a 0.1.1 while waiting for 0.2.0? Would be really nice to be able to use Accounts right now 😄

No, we’re really close to 0.2.0 and it would be a ton of work to cherrypick non-breaking changes to release 0.1.1.

I still think the flag is problematic and I vote for removing it, see https://github.com/OpenZeppelin/nile/pull/112 for example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Utilities - OpenZeppelin Docs
Account. MockSigner ... from utils import State starknet = await State.init() ... The Account class also provides access to the account contract class...
Read more >
How do I get my accounts' positions at Interactive Brokers ...
When I run the code above I get a series of (i) account numbers, (ii) the contract symbol, (iii) position and (iv) average...
Read more >
Convert registered shoppers to account-based shoppers
Export registered shoppers using bulk export API to a CSV or JSON format. See the section Perform Bulk Export and Import for more...
Read more >
Adding User Authentication — StarkNet documentation
A map from user (represented by account contract address) // to their balance. ... from starkware.starknet.common.syscalls import get_caller_address ...
Read more >
ape-starknet - PyPI
See the section below about Testing to learn more about test accounts. However, when using a live network, you will have to import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found