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

Fix ByteArray Issue #16

Merged
merged 3 commits into from
Sep 13, 2024
Merged

Fix ByteArray Issue #16

merged 3 commits into from
Sep 13, 2024

Conversation

byteZorvin
Copy link
Member

This pr fixes #15.

  • If we call name() on a token address by wrapping it in the new trait with ByteArray while it is using felt interface the call would fail when the dispatcher will try to deserialize the returned Span
  • So we use the underlying syscall to make the call
  • We can do a different kind of serialisation after checking the the length of the span(which will 1 for the felt and at 3 for ByteArray).
  • But that is not required since the way to serialise is same and the deployment message is of fixed length (token_address,name,symbol,decimals) and while deserialising we could check the length of the payload to deserialise it accordingly

src/bridge/token_bridge.cairo Outdated Show resolved Hide resolved
dispatcher.name().serialize(ref calldata);
dispatcher.symbol().serialize(ref calldata);

// Openzeppelin erc20 used felt252 as return types for `name()` and `symbol()` while
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Openzeppelin erc20 used felt252 as return types for `name()` and `symbol()` while
// Openzeppelin erc20 previously used felt252 as return types for `name()` and `symbol()` while

src/bridge/token_bridge.cairo Outdated Show resolved Hide resolved
@byteZorvin byteZorvin merged commit 0966661 into main Sep 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not support old OZ tokens Metadata interface.
2 participants