Skip to content

Instantly share code, notes, and snippets.

@katelynsills
Created November 5, 2019 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katelynsills/cae96071b38213516c29c04975491564 to your computer and use it in GitHub Desktop.
Save katelynsills/cae96071b38213516c29c04975491564 to your computer and use it in GitHub Desktop.
Mint and get exclusive payment
// Alice withdraws a payment for Bob from her purse.
import { makeMint } from '@agoric/ertp/core/mint';
const bucksMint = makeMint('bucks');
const purse = bucksMint.mint(1000, `alice's purse`);
const paymentForBob = purse.withdraw(10, `bob's money`);
// The particular methods of the bobsAgent object are up to Bob.
bobsAgent.receivePayment(paymentForBob);
// Bob receives an alleged payment from Alice.
// Bob claims it exclusively and validates it
// using an assay he had gotten independently.
const exclusivePayment = bucksAssay.claimAll(allegedPaymentFromAlice);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment