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

Upgraded Braavos account do not work in starknet.js #990

Open
PhilippeR26 opened this issue Mar 1, 2024 · 3 comments
Open

Upgraded Braavos account do not work in starknet.js #990

PhilippeR26 opened this issue Mar 1, 2024 · 3 comments
Assignees
Labels
Type: bug Something isn't working

Comments

@PhilippeR26
Copy link
Collaborator

Describe the bug
In the past, the ArgentX and Braavos account contract where both with a proxy. It means that there where :

  • a proxy contract at the account address, written in Cairo 0.
  • an implementation class of the account, written also in Cairo 0.

When you upgrade an old ArgentX account, the proxy contract is replaced by a Cairo 1 account contract, so no more proxy.
When you upgrade an old Braavos account, the Cairo 0 implementation class is replaced by a Cairo 1 account contract. So, you have still a Cairo 0 proxy, with a Cairo 1 implementation.
When Starknet.js is trying to identify the Cairo version of a such account, it will check the contract at the account address, here the proxy. As the proxy is Cairo 0, Starknet.js concludes falsely that the account is Cairo 0 version. If you try to perform a transaction, you have as a result the classical error Input too long for arguments.

To Reproduce
I have one account in Goerli Testnet in this situation : addr : 0x06b7d99f2621f1fb2d3263d7a085de5d5f40751c6d1055a0a6c8105038fd44d2

Expected behavior
I have identified 2 solutions :

  • Ask to the user to force to Cairo 1 :
const account0 = new Account(provider, account0Address, privateKey0,"1");
  • Modify Starknet.js to take into account the presence of a proxy.

Screenshots
N/A

Desktop (please complete the following information):

  • Browser & version [e.g. chrome, safari, webworker]
  • Node version [e.g. 16.0.1]
  • Starknet.js version v6
  • Network [devnet, testnet] any

Additional context
Add any other context about the problem here.

@PhilippeR26 PhilippeR26 added the Type: bug Something isn't working label Mar 1, 2024
@PhilippeR26
Copy link
Collaborator Author

Waiting a decision for the strategy to adopt...

@Jemiiah
Copy link

Jemiiah commented Apr 16, 2024

@PhilippeR26 is this work assignable?

@PhilippeR26
Copy link
Collaborator Author

Hello,
In fact, I am handling this one from start to finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants