diff --git a/contract/rollup.config.mjs b/contract/rollup.config.mjs index 7c13208e..b5617069 100644 --- a/contract/rollup.config.mjs +++ b/contract/rollup.config.mjs @@ -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'; @@ -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, }) => ({ @@ -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({ @@ -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, diff --git a/contract/src/swaparoo.proposal.js b/contract/src/swaparoo.proposal.js index da31aa5e..a1a01ecb 100644 --- a/contract/src/swaparoo.proposal.js +++ b/contract/src/swaparoo.proposal.js @@ -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),