0xpatrickdev / agoric-vault-collateral-proposal

CoreEval Proposal and Permits for Inter Vault Collateral Type
0 stars 3 forks source link

no ibc/toystatom tokens exist; should get testnet stATOM denom #2

Closed dckc closed 1 year ago

dckc commented 1 year ago

@0xpatrickdev overall, great work!

I'm looking at things in detail, and I see...

https://github.com/0xpatrickdev/agoric-vault-collateral-proposal/blob/1aa1b7036c3cf349ea9fb342f1474b53d1cf0a3f/add-stATOM.js#L11

The ibc/toyatom tokens exist because the bank section of the devnet genesis file says that certain accounts such as agoric1qpwx7anda8cd969ezlk8zh79pwndezfuaywwm6 have some of those tokens. The agoricdev-20 genesis file says nothing about ibc/toystatom.

establish denom by transferring testnet stATOM to Agoric devnet

In production, stATOM tokens will come over IBC. So ideally, someone should set up a relayer and transfer some testnet stATOM to the Agoric devnet, and we should use the IBC denom from that in this proposal. For example, see Oct 2022 notes on USDC_axl denom.

One can verify an IBC denom using denom-trace:

$ agd --node=https://main.rpc.agoric.net:443 query ibc-transfer denom-trace BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA
denom_trace:
  base_denom: uatom
  path: transfer/channel-5

See also:

work-around: restart devnet with another toy token

An alternative is to restart the agoric devnet with another toy token in genesis, but that doesn't test as much of the relevant machinery.

dckc commented 1 year ago

another possible interim step: don't use up the STATOM name, but call it STATOM1 or some such; that is: 1st test run. It's likely that by STATOM3 or 4 we'll have all the details just right and could then register STATOM.

There are some tricky constraints. For example, each denom can only be registered in the vbank once. So if we got the right denom registered as STATOM2, we won't be able to register it again as STATOM. hm.

dckc commented 1 year ago

oops! looks like this is a dup of #1

dckc commented 1 year ago

we ran into the "no tokens exist" part of this today, so I'm re-opening this, even though it's essentially the same as #1.

dckc commented 1 year ago

1M mock stATOM on devnet

We now have 1.2M mock stATOM at an address I control:

# agd --node=https://devnet.rpc.agoric.net:443 query bank balances agoric1xz3rvrnz944avmlslxukvlsxpadgrqd4gcdpnk
balances:
- amount: "1234567000200"
  denom: ibc/49C630713B2AB60653F76C0C58D43C2A64956803B4D422CACB6DD4AD016ED846

Tracing the denom, we can see it's called ubld on the other end. The other end is a local chain on my desktop.

# agd --node=https://devnet.rpc.agoric.net:443 query ibc-transfer denom-trace 49C630713B2AB60653F76C0C58D43C2A64956803B4D422CACB6DD4AD016ED846
denom_trace:
  base_denom: ubld
  path: transfer/channel-0

See also notes in discord thread:

ack: @michaelfig for agoric ibc-relay support

dckc commented 1 year ago

The mock stATOM worked all the way thru on ollinet: https://github.com/Agoric/agoric-sdk/issues/8176#issuecomment-1689127153

That addresses this issue to my satisfaction.