-
Notifications
You must be signed in to change notification settings - Fork 8
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
Execute IBC Token Transfer from smart contract #11
Comments
classDiagram
class Orchestrator {
makeLocalAccount()
getChain(name)
}
Orchestrator --> LocalOrchestrationAccount: makeLocalAccount
Orchestrator --> CosmosChain: getChain
OrchestrationAccount <|-- LocalAccountMethods
LocalAccountMethods <|-- LocalOrchestrationAccount
OrchestrationAccount <|-- CosmosOrchestrationAccount
class OrchestrationAccount {
getAddress()
transfer(amt, destAddr, opts?)
}
class CosmosChain {
makeAccount()
}
CosmosChain --> CosmosOrchestrationAccount: makeAccount
class LocalAccountMethods {
deposit(pmt, amtShape?)
}
class LocalOrchestrationAccount {
}
class CosmosOrchestrationAccount {
transfer(amt, destAddr, opts?) // TODO #9784
}
Note that
const localAcct = await orch.makeLocalAccount();
const amt = await localAcct.deposit(pmt); (TODO: Docs for Then: const amtTxfrd = await localAcct.transfer(amt, destAddr); The const destChain = await orch.getChain('osmosis');
const destAcct = await destChain.makeAccount();
const destAddr = destAcct.getAddress(); The await localTransfer(seat, localAcct, give); more docs TODOs:
|
I was getting this error, which made me then use the watch pattern i show here to solve it! solution using watch pattern: I want to document it here for whoever may run into it:
when calling await localAccount.transfer(amount, remoteAddress); calling The deposit succeeds: localAccount.deposit(pmt); trace2024-08-09T22:56:41.439Z SwingSet: ls: v10: Logging sent error stack (Error#1)
2024-08-09T22:56:41.439Z SwingSet: ls: v10: Error#1: 0ubld is smaller than 1ubld: insufficient funds
2024-08-09T22:56:41.439Z SwingSet: ls: v10: Error: 0ubld is smaller than 1ubld: insufficient funds
at apply ()
at Error (/bundled-source/.../node_modules/ses/src/error/tame-error-constructor.js:60)
at outbound (.../vats/src/bridge.js:162)
at outbound (.../vats/src/bridge.js:157)
at apply ()
at In "outbound" method of (BridgeManagerKit privateOutbounder) (/bundled-source/.../node_modules/@endo/exo/src/exo-tools.js:171)
at apply ()
at localApplyMethod (/bundled-source/.../node_modules/@endo/eventual-send/src/local.js:126)
at apply ()
at dispatchToHandler (/bundled-source/.../node_modules/@endo/eventual-send/src/handled-promise.js:156)
at win (/bundled-source/.../node_modules/@endo/eventual-send/src/handled-promise.js:505)
at ()
2024-08-09T22:56:41.439Z SwingSet: ls: v10: Error#1 ERROR_NOTE: Sent as error:liveSlots:v10#70001
2024-08-09T22:56:41.456Z SwingSet: ls: v17: Logging sent error stack (RemoteError(error:liveSlots:v10#70001)#1)
2024-08-09T22:56:41.456Z SwingSet: ls: v17: RemoteError(error:liveSlots:v10#70001)#1: 0ubld is smaller than 1ubld: insufficient funds
2024-08-09T22:56:41.456Z SwingSet: ls: v17: Error: 0ubld is smaller than 1ubld: insufficient funds
at apply ()
at Error (/bundled-source/.../node_modules/ses/src/error/tame-error-constructor.js:60)
at makeError (/bundled-source/.../node_modules/ses/src/error/assert.js:351)
at decodeErrorCommon (/bundled-source/.../node_modules/@endo/marshal/src/marshal.js:309)
at decodeFromSmallcaps (/bundled-source/.../node_modules/@endo/marshal/src/encodeToSmallcaps.js:437)
at fromCapData (/bundled-source/.../node_modules/@endo/marshal/src/marshal.js:398)
at notifyOnePromise (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1219)
at notify (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1243)
at dispatchToUserspace (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1512)
at runWithoutMetering (/bundled-source/.../packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js:59)
at ()
2024-08-09T22:56:41.456Z SwingSet: ls: v17: RemoteError(error:liveSlots:v10#70001)#1 ERROR_NOTE: Sent as error:liveSlots:v17#70001
2024-08-09T22:56:41.483Z SwingSet: ls: v45: Logging sent error stack (RemoteError(error:liveSlots:v17#70001)#1)
2024-08-09T22:56:41.483Z SwingSet: ls: v45: RemoteError(error:liveSlots:v17#70001)#1: 0ubld is smaller than 1ubld: insufficient funds
2024-08-09T22:56:41.483Z SwingSet: ls: v45: Error: 0ubld is smaller than 1ubld: insufficient funds
at apply ()
at Error (/bundled-source/.../node_modules/ses/src/error/tame-error-constructor.js:60)
at makeError (/bundled-source/.../node_modules/ses/src/error/assert.js:351)
at decodeErrorCommon (/bundled-source/.../node_modules/@endo/marshal/src/marshal.js:309)
at decodeFromSmallcaps (/bundled-source/.../node_modules/@endo/marshal/src/encodeToSmallcaps.js:437)
at fromCapData (/bundled-source/.../node_modules/@endo/marshal/src/marshal.js:398)
at notifyOnePromise (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1219)
at notify (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1243)
at dispatchToUserspace (/bundled-source/.../packages/swingset-liveslots/src/liveslots.js:1512)
at runWithoutMetering (/bundled-source/.../packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js:59)
at ()
with my new commit, the deposit, and transfer are happening from inside the contract now |
looking back into this issue |
do you have more context for the If you have instructions so that someone else should be able to reproduce it, I suggest opening a new issue and marking this blocked on it |
opened Agoric/agoric-sdk#9901 to track |
Context
In our call with @Jovonni on 2024-07-30, he mentioned this idea.
Problem Definition
Currently, the frontend sends toy tokens (BLD, IST) to Osmosis by executing the IBC transfer inside the browser instead of triggering an offer to have a smart contract to do it. I believe below method is the relevant part for this in frontend code;
dapp-orchestration-basics/ui/src/components/Orchestration/Orchestration.tsx
Line 100 in ea55e9c
In order to demonstrate orchestration features and do this incrementally, we can have a smart contract execute simple IBC transfer as our next step.
The text was updated successfully, but these errors were encountered: