Skip to content

Commit

Permalink
fix: supply swaparooCommittee voterAddresses on build/deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Mar 19, 2024
1 parent 1671b30 commit 952bedf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion contract/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
* - `permit` export is emitted as JSON
*/
// @ts-check
import process from 'node:process';
import {
coreEvalGlobals,
moduleToScript,
configureBundleID,
emitPermit,
configureOptions,
} from './tools/rollup-plugin-core-eval.js';
import { permit as postalServicePermit } from './src/postal-service.proposal.js';
import { permit as swapPermit } from './src/swaparoo.proposal.js';
Expand All @@ -30,6 +32,7 @@ const config1 = ({
coreEntry = `./src/${name}.proposal.js`,
contractEntry = `./src/${name}.contract.js`,
coreScript = `bundles/deploy-${name}.js`,
coreScriptOptions = undefined,
permitFile = `deploy-${name}-permit.json`,
permit,
}) => ({
Expand All @@ -51,11 +54,16 @@ const config1 = ({
}),
]
: []),
...(coreScriptOptions
? [configureOptions({ options: coreScriptOptions })]
: []),
moduleToScript(),
emitPermit({ permit, file: permitFile }),
],
});

const { env } = process;

/** @type {import('rollup').RollupOptions[]} */
const config = [
config1({
Expand All @@ -68,7 +76,15 @@ const config = [
name: 'sell-concert-tickets',
permit: sellPermit,
}),
config1({ name: 'swaparoo', permit: swapPermit }),
config1({
name: 'swaparoo',
permit: swapPermit,
coreScriptOptions: {
swaparooCommittee: {
voterAddresses: env.SWAP_GOV_ADDR ? { v1: env.SWAP_GOV_ADDR } : {},
},
},
}),
config1({
name: 'postal-service',
permit: postalServicePermit,
Expand Down
7 changes: 6 additions & 1 deletion contract/src/swaparoo.proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ export const startSwapContract = async powers => {
console.log(`${contractName} (re)started`);
};

export const main = (permittedPowers, config) =>
export const main = (
permittedPowers,
config = {
options: Fail`missing options config`,
},
) =>
allValues({
installation: installSwapContract(permittedPowers, config),
committeeFacets: startSwaparooCommittee(permittedPowers, config),
Expand Down

0 comments on commit 952bedf

Please sign in to comment.