Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 208 forks source link

Orchestration: use orchestrated flow as handler for monitorTransfer tap #10047

Open 0xpatrickdev opened 2 months ago

0xpatrickdev commented 2 months ago

What is the Problem Being Solved?

monitorTransfers(tap) allows a developer to monitor incoming and outgoing IBC transfers for a LocalChainAccount and react to them. auto-stake-it demonstrates how to do this:

However, if the receiveUpcall handler performs any multichain work, it must be written with vows: https://github.com/Agoric/agoric-sdk/blob/67275c2ac643b53bb74422cc92fe1f3565150d12/packages/orchestration/src/examples/auto-stake-it-tap-kit.js#L71-L130

Description of the Design

Demonstrate writing a tap where an orchestrated flow is the handler via auto-stake-it.

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

0xpatrickdev commented 2 months ago

Brainstorming - is there a path for adding logic to LocalOrchAccount.monitorTransfers that would allow the developer to specify a flow instead of an exo with a receiveUpcall method? If yes, is that helpful towards the goal of concision?