Skip to content

Commit

Permalink
fix: default and propagate the poolFee and protocolFee in treasury
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed May 4, 2021
1 parent ed6b84a commit d210bcf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/treasury/bundles/install-on-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import stablecoinBundle from './bundle-stablecoinMachine';
const SECONDS_PER_HOUR = 60n * 60n;
const SECONDS_PER_DAY = 24n * SECONDS_PER_HOUR;

const DEFAULT_POOL_FEE = 24n;
const DEFAULT_PROTOCOL_FEE = 6n;
/**
* @param {Object} param0
* @param {ERef<NameHub>} param0.agoricNames
Expand All @@ -19,8 +21,10 @@ const SECONDS_PER_DAY = 24n * SECONDS_PER_HOUR;
* @param {ERef<PriceAuthority>} param0.priceAuthority
* @param {ERef<ZoeService>} param0.zoe
* @param {NatValue} param0.bootstrapPaymentValue
* @param {NatValue} [param0.poolFee]
* @param {NatValue} [param0.protocolFee]
*/
export async function installOnChain({ agoricNames, board, centralName, chainTimerService, nameAdmins, priceAuthority, zoe, bootstrapPaymentValue }) {
export async function installOnChain({ agoricNames, board, centralName, chainTimerService, nameAdmins, priceAuthority, zoe, bootstrapPaymentValue, poolFee = DEFAULT_POOL_FEE, protocolFee = DEFAULT_PROTOCOL_FEE }) {
// Fetch the nameAdmins we need.
const [brandAdmin, installAdmin, instanceAdmin, issuerAdmin, uiConfigAdmin] = await Promise.all(
['brand', 'installation', 'instance', 'issuer', 'uiConfig'].map(async edge => {
Expand All @@ -45,6 +49,8 @@ export async function installOnChain({ agoricNames, board, centralName, chainTim
const loanParams = {
chargingPeriod: SECONDS_PER_HOUR,
recordingPeriod: SECONDS_PER_DAY,
poolFee,
protocolFee,
};

const terms = harden({
Expand Down

0 comments on commit d210bcf

Please sign in to comment.