Skip to content
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

WIP: interAsset contract: addVaultCollateral etc. #8

Draft
wants to merge 15 commits into
base: dc-launchpad
Choose a base branch
from

Conversation

dckc
Copy link
Collaborator

@dckc dckc commented Jan 6, 2024

cc @0xpatrickdev

DRAFT until:

  • interAsset contract: start mintHolder; add to vbank; add to vaultFactory, reserve, auction (UNTESTED)
  • core eval script to start interAsset contract
  • handle adding price feed
  • test adding vault collateral

stretch:

  • add PSM

@dckc
Copy link
Collaborator Author

dckc commented Apr 11, 2024

subsume mintHolder

idea: one interchainMints contract instead of N mintHolder contracts. privateArgs includes bankManager and nameAdmins for agoricNames.brand, agoricNames.issuer. creatorFacet includes makeInterchainAsset that

  • creates an IssuerKit
  • adds it to bankManager
  • adds it to agoricNames.brand, agoricNames.issuer

@dckc
Copy link
Collaborator Author

dckc commented Apr 11, 2024

subsume mintHolder

idea: one interchainMints contract instead of N mintHolder contracts. ...

it was pretty straightforward:

$ yarn test test/test-interchainMints.js 
yarn run v1.22.21
$ ava --verbose test/test-interchainMints.js

    before hook
    ℹ bootstrap
    ...
bundles/ bundle-interchainMints.js valid: 121 files bundled at 2024-04-11T17:23:16.719Z
  ✔ install interchainMints bundle
    ℹ publish bundle interchainMints b1-0f39c
interchainMints (re-)installed as b1-0f39c
  ✔ interchainMints contract adds IBC tokens to vbank (262ms)
    ℹ interchainMintsKit {
        adminFacet: Object @Alleged: adminFacet {},
        creatorFacet: Object @Alleged: InterchainMints {},
        creatorInvitation: undefined,
        instance: Object @Alleged: InstanceHandle {},
        publicFacet: Object @Alleged: Incapable {},
      }
    ℹ E(Asset1).makeEmptyPurse() works: {
        brand: Object @Alleged: Asset1 brand {},
        value: 0n,
      }
    ℹ E(Asset2).makeEmptyPurse() works: {
        brand: Object @Alleged: Asset2 brand {},
        value: 0n,
      }
    ℹ agoricNames.vbankAsset: {
        'ibc/1234567890123456789012345678901234567890123456789012345678901234': {
          brand: Object @Alleged: Asset1 brand {},
          denom: 'ibc/1234567890123456789012345678901234567890123456789012345678901234',
          displayInfo: {
            assetKind: 'nat',
            decimalPlaces: 6,
          },
          issuer: Object @Alleged: Asset1 issuer {},
          issuerName: 'Asset1',
          proposedName: 'Asset1',
        },
        'ibc/2234567890123456789012345678901234567890123456789012345678901234': {
          brand: Object @Alleged: Asset2 brand {},
          denom: 'ibc/2234567890123456789012345678901234567890123456789012345678901234',
          displayInfo: {
            assetKind: 'nat',
            decimalPlaces: 6,
          },
          issuer: Object @Alleged: Asset2 issuer {},
          issuerName: 'Asset2',
          proposedName: 'Asset2',
        },
      }
interchainMints start args: {
  installation: Promise { Object [Alleged: BundleIDInstallation] {} },
  privateArgs: {
    nameAdmins: {
      brand: Object [Alleged: NameHubKit nameAdmin] {},
      issuer: Object [Alleged: NameHubKit nameAdmin] {}
    },
    bankManager: Object [Alleged: BankManager] {}
  }
}
interchainMints started
  ─

  2 tests passed
Done in 1.29s.

cc @0xpatrickdev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant