diff --git a/contracts/contracts/FundingRoundFactory.sol b/contracts/contracts/FundingRoundFactory.sol index 271ea07e7..9c7f3cf41 100644 --- a/contracts/contracts/FundingRoundFactory.sol +++ b/contracts/contracts/FundingRoundFactory.sol @@ -46,9 +46,6 @@ contract FundingRoundFactory is Ownable, MACISharedObjs { maciFactory = _maciFactory; verifiedUserRegistry = _verifiedUserRegistry; recipientRegistry = _recipientRegistry; - recipientRegistry.setController(); - (,, uint256 maxVoteOptions) = maciFactory.maxValues(); - recipientRegistry.setMaxRecipients(maxVoteOptions); } /** @@ -98,8 +95,6 @@ contract FundingRoundFactory is Ownable, MACISharedObjs { _signUpDuration, _votingDuration ); - (,, uint256 maxVoteOptions) = maciFactory.maxValues(); - recipientRegistry.setMaxRecipients(maxVoteOptions); } /** diff --git a/contracts/e2e/index.ts b/contracts/e2e/index.ts index a42182b51..4bc8a2ada 100644 --- a/contracts/e2e/index.ts +++ b/contracts/e2e/index.ts @@ -55,6 +55,8 @@ describe('End-to-end Tests', function () { verifiedUserRegistry = await SimpleUserRegistry.deploy() const SimpleRecipientRegistry = await ethers.getContractFactory('SimpleRecipientRegistry', deployer) recipientRegistry = await SimpleRecipientRegistry.deploy() + await recipientRegistry.setController() + await recipientRegistry.setMaxRecipients(24) const FundingRoundFactory = await ethers.getContractFactory('FundingRoundFactory', deployer) fundingRoundFactory = await FundingRoundFactory.deploy( maciFactory.address, diff --git a/contracts/scripts/deploy.ts b/contracts/scripts/deploy.ts index e98623e6e..eafa63fef 100644 --- a/contracts/scripts/deploy.ts +++ b/contracts/scripts/deploy.ts @@ -15,6 +15,8 @@ async function main() { deployer, ) const recipientRegistry = await SimpleRecipientRegistry.deploy() + await recipientRegistry.setController() + await recipientRegistry.setMaxRecipients(24) const FundingRoundFactory = await ethers.getContractFactory( 'FundingRoundFactory', diff --git a/contracts/scripts/deployTestRound.ts b/contracts/scripts/deployTestRound.ts index 21f382800..13f03cc96 100644 --- a/contracts/scripts/deployTestRound.ts +++ b/contracts/scripts/deployTestRound.ts @@ -10,7 +10,7 @@ import MACIFactoryArtifact from '../build/contracts/MACIFactory.json' async function main() { // We're hardcoding factory address due to a buidler limitation: // https://github.com/nomiclabs/buidler/issues/651 - const factoryAddress = '0x1A1FEe7EeD918BD762173e4dc5EfDB8a78C924A8' + const factoryAddress = '0xc4905364b78a742ccce7B890A89514061E47068D' const [ deployer, coordinator, diff --git a/contracts/tests/factory.ts b/contracts/tests/factory.ts index da6dd988d..f4550519a 100644 --- a/contracts/tests/factory.ts +++ b/contracts/tests/factory.ts @@ -33,6 +33,8 @@ describe('Funding Round Factory', () => { const SimpleRecipientRegistry = await ethers.getContractFactory('SimpleRecipientRegistry', deployer) recipientRegistry = await SimpleRecipientRegistry.deploy() + await recipientRegistry.setController() + await recipientRegistry.setMaxRecipients(24) const FundingRoundFactory = await ethers.getContractFactory('FundingRoundFactory', deployer) factory = await FundingRoundFactory.deploy( @@ -58,7 +60,7 @@ describe('Funding Round Factory', () => { expect(await factory.nativeToken()).to.equal(ZERO_ADDRESS) expect(await factory.maciFactory()).to.equal(maciFactory.address) expect(await factory.recipientRegistry()).to.equal(recipientRegistry.address) - expect(await recipientRegistry.controller()).to.equal(factory.address) + expect(await recipientRegistry.controller()).to.equal(deployer.address) expect(await recipientRegistry.maxRecipients()) .to.equal(5 ** maciParameters.voteOptionTreeDepth - 1) }) @@ -118,8 +120,8 @@ describe('Funding Round Factory', () => { maciParameters.update({ voteOptionTreeDepth: 3 }) await expect(factory.setMaciParameters(...maciParameters.values())) .to.emit(maciFactory, 'MaciParametersChanged') - expect(await recipientRegistry.maxRecipients()) - .to.equal(5 ** maciParameters.voteOptionTreeDepth - 1) + const treeDepths = await maciFactory.treeDepths() + expect(treeDepths.voteOptionTreeDepth).to.equal(3) }); it('allows only owner to set MACI parameters', async () => { diff --git a/vue-app/.env.example b/vue-app/.env.example index a179a6559..df64fac8a 100644 --- a/vue-app/.env.example +++ b/vue-app/.env.example @@ -1,5 +1,5 @@ VUE_APP_ETHEREUM_API_URL=http://localhost:18545 VUE_APP_BLOCK_EXPLORER=https://etherscan.io/tx/ VUE_APP_IPFS_GATEWAY_URL=https://ipfs.io/ipfs/ -VUE_APP_CLRFUND_FACTORY_ADDRESS=0x1A1FEe7EeD918BD762173e4dc5EfDB8a78C924A8 +VUE_APP_CLRFUND_FACTORY_ADDRESS=0xc4905364b78a742ccce7B890A89514061E47068D VUE_APP_USER_REGISTRY_TYPE=simple