diff --git a/eth-contracts/test/audiusToken.test.js b/eth-contracts/test/audiusToken.test.js index a11d831b431..edf39f242a3 100644 --- a/eth-contracts/test/audiusToken.test.js +++ b/eth-contracts/test/audiusToken.test.js @@ -96,7 +96,7 @@ contract('AudiusToken', async (accounts) => { assert.equal(await token.balanceOf(tokenOwnerAddress), INITIAL_SUPPLY - amount) assert.equal(await token.balanceOf(account), amount) assert.equal(await token.totalSupply(), INITIAL_SUPPLY) - + // Decrease total supply by burning from account await token.approve(tokenOwnerAddress, amount, { from: account }) await token.burnFrom(account, amount, { from: tokenOwnerAddress }) @@ -231,6 +231,13 @@ contract('AudiusToken', async (accounts) => { ) }) + it('Confirm token reinitialization fails', async () => { + await _lib.assertRevert( + token.initialize(proxyDeployerAddress, accounts[13]), + 'Contract instance has already been initialized' + ) + }) + describe('EIP-2612', async function () { it('Confirm typehashes match for permit function', async () => { const chainId = 1 // in ganache, the chain ID the token initializes with is always 1 diff --git a/eth-contracts/test/delegateManagerV2.test.js b/eth-contracts/test/delegateManagerV2.test.js index 52aeffa7817..dd8ddcaffc1 100644 --- a/eth-contracts/test/delegateManagerV2.test.js +++ b/eth-contracts/test/delegateManagerV2.test.js @@ -521,6 +521,13 @@ contract('DelegateManagerV2', async (accounts) => { assert.isTrue((info.deployerCut).eq(_lib.toBN(updatedCut)), 'Expect updated cut') }) + it('Confirm DelegateManagerV2 fails reinitialization', async () => { + await _lib.assertRevert( + delegateManager.initialize(token.address, governance.address, UNDELEGATE_LOCKUP_DURATION), + 'Contract instance has already been initialized' + ) + }) + it('Initial state + claim', async () => { // Validate basic claim w/SP path let spStake = (await serviceProviderFactory.getServiceProviderDetails(stakerAccount)).deployerStake diff --git a/eth-contracts/test/governance.test.js b/eth-contracts/test/governance.test.js index 0df631eacc2..59a3f0be9e4 100644 --- a/eth-contracts/test/governance.test.js +++ b/eth-contracts/test/governance.test.js @@ -313,6 +313,13 @@ contract('Governance.sol', async (accounts) => { ) }) + it('Confirm governance fails reinitialization', async () => { + await _lib.assertRevert( + governance.initialize(registry.address, 0, 0, 0, 10, accounts[14]), + 'Contract instance has already been initialized' + ) + }) + it('Initialize require statements', async function () { const governance0 = await Governance.new({ from: proxyDeployerAddress }) const newMaxInProgressProposals = 100 diff --git a/eth-contracts/test/staking.test.js b/eth-contracts/test/staking.test.js index 807e862374b..510905b8b10 100644 --- a/eth-contracts/test/staking.test.js +++ b/eth-contracts/test/staking.test.js @@ -110,6 +110,13 @@ contract('Staking test', async (accounts) => { stakingAddress = staking.address }) + it('Confirm staking fails reinitialization', async () => { + await _lib.assertRevert( + staking.initialize(token.address, accounts[14]), + 'Contract instance has already been initialized' + ) + }) + it('has correct initial state', async () => { assert.equal(await staking.token({ from: accounts[13]}), token.address, 'Token is wrong') assert.equal((await staking.totalStaked()).valueOf(), 0, 'Initial total staked amount should be zero')