π§
@mintcloud
Can Frames support use cases that involve a token swap (buy token A with token B)? My 3 favorite ideas in the replies will get 20 USDC each @bountybot
4 replies
0 recast
0 reaction
eric
@tintin
AFAIK not really. The concept of signing within a Frame is in the context of a unique generated key, which is independent on your connected wallet address. Thus it has no funds and can't make approvals / token transfers. However with some additional setup I think it could be possible... cont.
2 replies
0 recast
0 reaction
eric
@tintin
A very simple example would be a permissioned router. You approve this contract from your connected wallet address (so that it can swap for you), and you trust an off chain service (i.e. the frames backend) to trigger the swap to happen. There must be correct permissions on who can "trigger" the swap to happen... cont.
1 reply
0 recast
0 reaction
eric
@tintin
Since it can lead to loss of funds depending on how the contracts are written. You can remove some trust in the off chain service by checking that the signer of the message received in the Frame, but at the end of the day you'll still have a centralized off chain entity controlling the swapping contract so not ideal.
1 reply
0 recast
0 reaction
eric
@tintin
Hope this was helpful apologies for the word dump
1 reply
0 recast
0 reaction
π§
@mintcloud
Super helpful, thanks! It seems to me that these permissioned routers do exist, an example of that is 0x API (disclaimer: I work at 0x) The frame backend sends a trade request, 0x API returns a calldata that the wallet signs and sends onchain to perform the swap https://0x.org/docs/0x-swap-api/introduction
1 reply
0 recast
1 reaction
eric
@tintin
Right the issue with Frames though is that afaik there's no way currently to have the connected wallet (which has funds) to sign anything, so you need some trusted intermediary to greenlight the trade.
0 reply
0 recast
1 reaction