You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swap requester can cancel their request whenever they want to
Overview
flowchart TD
Buyer[Buyer] --> |1.Allocate 1ETH for buyer to be spent by the Owner Canister|icrc2_approve_to --> |2.1ETH -> 10CDAO|Owner[Owner]--> |3.The Owner has two optiond to accept the swap request or to decline it|AcceptOrDecline{AcceptOrDecline}
AcceptOrDecline --> |4..Owner accepts the request|Accept[Accept]
AcceptOrDecline --> |4.The Owner declined the swap request|Decline[Decline]
Accept -->|5.Do the swap|Buyer --> |6.Transfer tokens from buyer to owner|Owner --> |7.Transfer tokens from Owner to Buyer|Buyer--> |8.Check if the token thats being given inplace of the Owner's token has a value or not|get_token_price{get_token_price}
get_token_price --> |9.If the token is priced|Priced --> |10.Update Owner latest_swap_price for that token|Update --> |11.Update the Owner's canister data|Owner
get_token_price --> |9.The token is not priced|NotPriced
flowchart TD
swap_request[token_a --> token_b] --> token_a
swap_request --> token_b
token_a --> |1.Check if the token has icrc2 support|is_icrc2_supported_token
token_b --> |2.Check if the token has icrc2 support|is_icrc2_supported_token --> |3.Check if this canister is the token owner|is_token_creator
token_b --> is_token_creator --> |4.Allocate token_a with expiry 1wk|icrc2_approve
token_a --> icrc2_approve
Loading
swap_request_action
Swapping is the transfer of token_a from requester_princiapl to the caller and token_b from caller to requester_principal
Overview
Caller Callee Flow
swap_request
swap_request_action
get_token_price
cancel_swap_request
The text was updated successfully, but these errors were encountered: