I hereby claim:
- I am katelynsills on github.
- I am kate_sills (https://keybase.io/kate_sills) on keybase.
- I have a public key ASAoaGeWMR7V9a8pMqV6lqqbVeca7MWjKZZ2nw_krPUAHAo
To claim this, I am signing this object:
const offerRules = harden({ | |
payoutRules: [ | |
{ | |
kind: 'want', | |
units: tickets(1), | |
}, | |
{ | |
kind: 'offer', | |
units: dollars(10), | |
}, |
export const makeContract = (zoe, terms) => { | |
return { | |
instance: { | |
makeOffer: async escrowReceipt => { | |
const { offerHandle } = await zoe.burnEscrowReceipt(escrowReceipt); | |
zoe.complete([offerHandle]); | |
}, | |
}, | |
assays: terms.assays, | |
}; |
import { makeMint } from '@agoric/ertp/core/mint'; | |
const baytownBucksMint = makeMint('BaytownBucks'); | |
const purse = baytownBucksMint.mint(1000, 'community treasury'); | |
const paymentForAlice = purse.withdraw(10, `alice's community money`); | |
alice.receivePayment(paymentForAlice); |
I hereby claim:
To claim this, I am signing this object:
updateState(newState) { | |
state = newState; | |
listeners.forEach(listener => { | |
Promise.resolve(listener).then(ev => ev.stateChanged(newState)); | |
}); | |
}, | |
const financeListener = { | |
stateChanged(state) { | |
if (state < 4000) { | |
Promise.resolve(bankAccount).then(ba => ba.deposit(1000)); | |
} | |
}, | |
}; |
/* make listener infrastructure */ | |
function makeStateHolder() { | |
let state = undefined; | |
const listeners = []; | |
return { | |
addListener(newListener) { | |
listeners.push(newListener); | |
}, |
function makeStateHolder() { | |
let state = undefined; | |
const listeners = []; | |
return { | |
addListener(newListener) { | |
listeners.push(newListener); | |
}, | |
getState() { | |
return state; |
function makeStateHolder() { | |
let state = undefined; | |
const listeners = []; | |
return { | |
addListener(newListener) { | |
listeners.push(newListener); | |
}, | |
getState() { | |
return state; |
function makeBankAccount(balance) { | |
stateHolder.updateState(balance); | |
return { | |
withdraw(amount) { | |
balance -= amount; | |
stateHolder.updateState(balance); | |
}, | |
deposit(amount) { | |
balance += amount; | |
stateHolder.updateState(balance); |