Skip to content

Commit

Permalink
Rename ERTP (#152)
Browse files Browse the repository at this point in the history
* rename. rename files in separate commit

* rename files
  • Loading branch information
katelynsills authored Oct 5, 2019
1 parent 6867a9c commit a34dad1
Show file tree
Hide file tree
Showing 51 changed files with 1,304 additions and 1,236 deletions.
8 changes: 4 additions & 4 deletions GALLERY-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ reference, it can't. For more on object capabilities, see [Chip
Morningstar's
post](http://habitatchronicles.com/2017/05/what-are-capabilities/).
For more on ERTP, [see a quick tutorial](README.md) and the ERTP
interface descriptions [for issuers.js](core/issuers.chainmail),
[assays.js](core/assays.chainmail) and [contractHost.js](core/contractHost.chainmail).
interface descriptions [for assay.js](core/assay.chainmail),
[descOps.js](core/descOps.chainmail) and [contractHost.js](core/contractHost.chainmail).


## A preemption hierarchy of rights
Expand Down Expand Up @@ -101,8 +101,8 @@ payment.
## Buying and selling pixels

The users can buy and sell pixels with the gallery at any time by
calling `sellToGallery(pixelAmount)` and
`buyFromGallery(pixelAmount)`. They must pass in an `amount` that
calling `sellToGallery(pixelAssetDesc)` and
`buyFromGallery(pixelAssetDesc)`. They must pass in an `assetDesc` that
describes exactly what they want to sell or buy. If successful, they
will get an invitation from the gallery for a simple, secure escrow
exchange of the pixels for "dust", the currency that the gallery
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ that the alleged payment was valid, and get a new payment that is
exclusively hers:

```js
const myExclusivePayment = BaytownBucksIssuer.claimAll(allegedPayment);
const myExclusivePayment = BaytownBucksAssay.claimAll(allegedPayment);
```

The BaytownBucksIssuer is associated with the BaytownBucksMint, but
the issuer is the public-facing version that is accessible to anyone.
The BaytownBucksAssay is associated with the BaytownBucksMint, but
the assay is the public-facing version that is accessible to anyone.
By holding the reference to a mint, you can mint more tokens. By
holding a reference to the issuer for a mint, you can check that a
holding a reference to the assay for a mint, you can check that a
payment is valid and exclusively claim it in a new payment to yourself.

That's the basic use case for a fungible token. `makeMint` in
[issuers.js](core/issuers.js) takes
[mint.js](core/mint.js) takes
in an optional configuration that allows for many more possibilities.

## Pixel Gallery Demo
Expand Down
120 changes: 0 additions & 120 deletions core/assay.js

This file was deleted.

133 changes: 0 additions & 133 deletions core/assays.chainmail

This file was deleted.

10 changes: 5 additions & 5 deletions core/config/basicFungibleConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import harden from '@agoric/harden';

import { noCustomization } from './noCustomization';
import { makeCoreMintKeeper } from './coreMintKeeper';
import { natStrategy } from './strategies/natStrategy';
import { natExtentOps } from './extentOps/natExtentOps';

// Fungible tokens (our default for mints) do not customize
// payments, purses, etc. They use the "basic" mintKeeper (the place
// where the amounts per purse and payment are recorded) and use the
// "Nat" assay, in which amounts are natural numbers and use
// where the assetDescs per purse and payment are recorded) and use the
// "Nat" descOps, in which assetDescs are natural numbers and use
// substraction and addition.

// This configuration and others like it are passed into `makeMint` in
// `issuers.js`.
// `mint.js`.
function makeBasicFungibleConfig() {
return harden({
...noCustomization,
makeMintKeeper: makeCoreMintKeeper,
strategy: natStrategy,
extentOps: natExtentOps,
});
}

Expand Down
22 changes: 11 additions & 11 deletions core/config/coreMintKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import { makePrivateName } from '../../util/PrivateName';
export function makeCoreMintKeeper() {
// An asset can either be a purse or payment. An asset keeper
// keeps track of either all of the purses (purseKeeper) or all
// of the payments (paymentKeeper) and their respective amounts.
// of the payments (paymentKeeper) and their respective assetDescs.
function makeAssetKeeper() {
// asset to amount
const amounts = makePrivateName();
// asset to assetDesc
const assetDescs = makePrivateName();
return harden({
updateAmount(asset, newAmount) {
amounts.set(asset, newAmount);
updateAssetDesc(asset, newAssetDesc) {
assetDescs.set(asset, newAssetDesc);
},
recordNew(asset, initialAmount) {
amounts.init(asset, initialAmount);
recordNew(asset, initialAssetDesc) {
assetDescs.init(asset, initialAssetDesc);
},
getAmount(asset) {
return amounts.get(asset);
getAssetDesc(asset) {
return assetDescs.get(asset);
},
has(asset) {
return amounts.has(asset);
return assetDescs.has(asset);
},
remove(asset) {
amounts.delete(asset);
assetDescs.delete(asset);
},
});
}
Expand Down
Loading

0 comments on commit a34dad1

Please sign in to comment.