ArkProjectNFTs / ark-project

ArkProject is a liquidity layer for digital assets, uniting markets, empowering creators, and bridging the gap to mass adoption. Built on top of Starknet, ArkProject is designed to provide a fully decentralized and trustless orderbook on-chain.
https://arkproject.dev
Apache License 2.0
25 stars 8 forks source link

Handle failed starknet transactions #291

Closed ybensacq closed 4 months ago

ybensacq commented 5 months ago

Is this feature related to a problem? Please describe. Implement the on_starknet_tx_failed Method to Handle Failed Transactions from L2: Upon receiving a 'failed' status from L2, the state of the smart contract should be updated to 'placed'.

Describe the solution you'd like

update the function on_starknet_tx_failed in solis crate

kwiss commented 5 months ago

Typically there's also case where amount in the allowance of the erc20 is in error i don't know why, in that case we should also revert the state


2024-02-16T22:44:30.411606Z ERROR katana_core::service::messaging::starknet: Error sending transaction: Provider(StarknetError(ContractError(ContractErrorData { revert_error: "Execution error at transaction index 0: Error in the called contract (0x05ed5822d2bc13c279362b01fd661c63dd64fd7558c31a89c0f078edf74fce3c):\nError at pc=0:4573:\nGot an exception while executing a hint.\nCairo traceback (most recent call last):\nUnknown location (pc=0:67)\nUnknown location (pc=0:1835)\nUnknown location (pc=0:2478)\nUnknown location (pc=0:3255)\nUnknown location (pc=0:3795)\n\nError in the called contract (0x073148536f8ea9546e92761d11515548cc433df46883d5ee98871a6f63a0bbbc):\nError at pc=0:3500:\nGot an exception while executing a hint: Custom Hint Error: Execution failed. Failure reason: 0x753235365f737562204f766572666c6f77 ('u256_sub Overflow').\nCairo traceback (most recent call last):\nUnknown location (pc=0:1057)\nUnknown location (pc=0:2547)\n" })))
```