-
Notifications
You must be signed in to change notification settings - Fork 596
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
bug: Attempted to merge branches with different bases to align get_tx_info() #2932
Labels
bug
Something isn't working
Comments
created a shorter non-contract based version:
attempting to understand why we add fail to correctly merge branches here. |
Hi ! I'm facing a similar issue with nested conditions. fn _lockTokens(tokenAddress: starknet::ContractAddress, tokenId: u256, amount: u256, isNative: bool) {
let caller = starknet::get_caller_address();
let contractAddress = starknet::get_contract_address();
if (tokenAddress.isERC721()) {
let ERC721 = IERC721Dispatcher { contract_address: tokenAddress };
if (isNative) {
ERC721.transferFrom(from: caller, to: contractAddress, :tokenId);
} else {
// check if caller is owner before burning
assert(ERC721.ownerOf(:tokenId) == caller, 'You do not own this token');
ERC721.burn(:tokenId);
}
} else if (tokenAddress.isERC1155()) {
assert(amount > u256 {low: 0, high: 0 }, 'Cannot deposit null amount');
let ERC1155 = IERC1155Dispatcher { contract_address: tokenAddress };
if (isNative) {
ERC1155.safeTransferFrom(
from: caller,
to: contractAddress,
:tokenId,
:amount,
data: ArrayTrait::<felt252>::new()
);
} else {
ERC1155.burn(from: caller, :tokenId, :amount);
}
} else {
panic_with_felt252('Kass: Unkown token standard');
}
} It works if I remove one of the nested Hope it helps 🤷♀️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
This code was tried at fd5e6fe.
It works at the height on which of alpha.7 was released 81c4eb9
Running into
I tried to take out as much of the non faulty code as possible:
If I move let tx_info = get_tx_info().unbox outside of the “if” it works.
If I comment asssert_no_self_call it also works...
It should be possible to run such code.
The text was updated successfully, but these errors were encountered: