ERC20VotesComp.test.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. /* eslint-disable */
  2. const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers');
  3. const { expect } = require('chai');
  4. const { MAX_UINT256, ZERO_ADDRESS, ZERO_BYTES32 } = constants;
  5. const { fromRpcSig } = require('ethereumjs-util');
  6. const ethSigUtil = require('eth-sig-util');
  7. const Wallet = require('ethereumjs-wallet').default;
  8. const ERC20VotesCompMock = artifacts.require('ERC20VotesCompMock');
  9. const { batchInBlock } = require('../../../helpers/txpool');
  10. const { EIP712Domain, domainSeparator } = require('../../../helpers/eip712');
  11. const Delegation = [
  12. { name: 'delegatee', type: 'address' },
  13. { name: 'nonce', type: 'uint256' },
  14. { name: 'expiry', type: 'uint256' },
  15. ];
  16. contract('ERC20VotesComp', function (accounts) {
  17. const [ holder, recipient, holderDelegatee, recipientDelegatee, other1, other2 ] = accounts;
  18. const name = 'My Token';
  19. const symbol = 'MTKN';
  20. const version = '1';
  21. const supply = new BN('10000000000000000000000000');
  22. beforeEach(async function () {
  23. this.token = await ERC20VotesCompMock.new(name, symbol);
  24. // We get the chain id from the contract because Ganache (used for coverage) does not return the same chain id
  25. // from within the EVM as from the JSON RPC interface.
  26. // See https://github.com/trufflesuite/ganache-core/issues/515
  27. this.chainId = await this.token.getChainId();
  28. });
  29. it('initial nonce is 0', async function () {
  30. expect(await this.token.nonces(holder)).to.be.bignumber.equal('0');
  31. });
  32. it('domain separator', async function () {
  33. expect(
  34. await this.token.DOMAIN_SEPARATOR(),
  35. ).to.equal(
  36. await domainSeparator(name, version, this.chainId, this.token.address),
  37. );
  38. });
  39. it('minting restriction', async function () {
  40. const amount = new BN('2').pow(new BN('96'));
  41. await expectRevert(
  42. this.token.mint(holder, amount),
  43. 'ERC20Votes: total supply risks overflowing votes',
  44. );
  45. });
  46. describe('set delegation', function () {
  47. describe('call', function () {
  48. it('delegation with balance', async function () {
  49. await this.token.mint(holder, supply);
  50. expect(await this.token.delegates(holder)).to.be.equal(ZERO_ADDRESS);
  51. const { receipt } = await this.token.delegate(holder, { from: holder });
  52. expectEvent(receipt, 'DelegateChanged', {
  53. delegator: holder,
  54. fromDelegate: ZERO_ADDRESS,
  55. toDelegate: holder,
  56. });
  57. expectEvent(receipt, 'DelegateVotesChanged', {
  58. delegate: holder,
  59. previousBalance: '0',
  60. newBalance: supply,
  61. });
  62. expect(await this.token.delegates(holder)).to.be.equal(holder);
  63. expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal(supply);
  64. expect(await this.token.getPriorVotes(holder, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  65. await time.advanceBlock();
  66. expect(await this.token.getPriorVotes(holder, receipt.blockNumber)).to.be.bignumber.equal(supply);
  67. });
  68. it('delegation without balance', async function () {
  69. expect(await this.token.delegates(holder)).to.be.equal(ZERO_ADDRESS);
  70. const { receipt } = await this.token.delegate(holder, { from: holder });
  71. expectEvent(receipt, 'DelegateChanged', {
  72. delegator: holder,
  73. fromDelegate: ZERO_ADDRESS,
  74. toDelegate: holder,
  75. });
  76. expectEvent.notEmitted(receipt, 'DelegateVotesChanged');
  77. expect(await this.token.delegates(holder)).to.be.equal(holder);
  78. });
  79. });
  80. describe('with signature', function () {
  81. const delegator = Wallet.generate();
  82. const delegatorAddress = web3.utils.toChecksumAddress(delegator.getAddressString());
  83. const nonce = 0;
  84. const buildData = (chainId, verifyingContract, message) => ({ data: {
  85. primaryType: 'Delegation',
  86. types: { EIP712Domain, Delegation },
  87. domain: { name, version, chainId, verifyingContract },
  88. message,
  89. }});
  90. beforeEach(async function () {
  91. await this.token.mint(delegatorAddress, supply);
  92. });
  93. it('accept signed delegation', async function () {
  94. const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
  95. delegator.getPrivateKey(),
  96. buildData(this.chainId, this.token.address, {
  97. delegatee: delegatorAddress,
  98. nonce,
  99. expiry: MAX_UINT256,
  100. }),
  101. ));
  102. expect(await this.token.delegates(delegatorAddress)).to.be.equal(ZERO_ADDRESS);
  103. const { receipt } = await this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s);
  104. expectEvent(receipt, 'DelegateChanged', {
  105. delegator: delegatorAddress,
  106. fromDelegate: ZERO_ADDRESS,
  107. toDelegate: delegatorAddress,
  108. });
  109. expectEvent(receipt, 'DelegateVotesChanged', {
  110. delegate: delegatorAddress,
  111. previousBalance: '0',
  112. newBalance: supply,
  113. });
  114. expect(await this.token.delegates(delegatorAddress)).to.be.equal(delegatorAddress);
  115. expect(await this.token.getCurrentVotes(delegatorAddress)).to.be.bignumber.equal(supply);
  116. expect(await this.token.getPriorVotes(delegatorAddress, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  117. await time.advanceBlock();
  118. expect(await this.token.getPriorVotes(delegatorAddress, receipt.blockNumber)).to.be.bignumber.equal(supply);
  119. });
  120. it('rejects reused signature', async function () {
  121. const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
  122. delegator.getPrivateKey(),
  123. buildData(this.chainId, this.token.address, {
  124. delegatee: delegatorAddress,
  125. nonce,
  126. expiry: MAX_UINT256,
  127. }),
  128. ));
  129. await this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s);
  130. await expectRevert(
  131. this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s),
  132. 'ERC20Votes: invalid nonce',
  133. );
  134. });
  135. it('rejects bad delegatee', async function () {
  136. const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
  137. delegator.getPrivateKey(),
  138. buildData(this.chainId, this.token.address, {
  139. delegatee: delegatorAddress,
  140. nonce,
  141. expiry: MAX_UINT256,
  142. }),
  143. ));
  144. const receipt = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s);
  145. const { args } = receipt.logs.find(({ event }) => event == 'DelegateChanged');
  146. expect(args.delegator).to.not.be.equal(delegatorAddress);
  147. expect(args.fromDelegate).to.be.equal(ZERO_ADDRESS);
  148. expect(args.toDelegate).to.be.equal(holderDelegatee);
  149. });
  150. it('rejects bad nonce', async function () {
  151. const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
  152. delegator.getPrivateKey(),
  153. buildData(this.chainId, this.token.address, {
  154. delegatee: delegatorAddress,
  155. nonce,
  156. expiry: MAX_UINT256,
  157. }),
  158. ));
  159. await expectRevert(
  160. this.token.delegateBySig(delegatorAddress, nonce + 1, MAX_UINT256, v, r, s),
  161. 'ERC20Votes: invalid nonce',
  162. );
  163. });
  164. it('rejects expired permit', async function () {
  165. const expiry = (await time.latest()) - time.duration.weeks(1);
  166. const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
  167. delegator.getPrivateKey(),
  168. buildData(this.chainId, this.token.address, {
  169. delegatee: delegatorAddress,
  170. nonce,
  171. expiry,
  172. }),
  173. ));
  174. await expectRevert(
  175. this.token.delegateBySig(delegatorAddress, nonce, expiry, v, r, s),
  176. 'ERC20Votes: signature expired',
  177. );
  178. });
  179. });
  180. });
  181. describe('change delegation', function () {
  182. beforeEach(async function () {
  183. await this.token.mint(holder, supply);
  184. await this.token.delegate(holder, { from: holder });
  185. });
  186. it('call', async function () {
  187. expect(await this.token.delegates(holder)).to.be.equal(holder);
  188. const { receipt } = await this.token.delegate(holderDelegatee, { from: holder });
  189. expectEvent(receipt, 'DelegateChanged', {
  190. delegator: holder,
  191. fromDelegate: holder,
  192. toDelegate: holderDelegatee,
  193. });
  194. expectEvent(receipt, 'DelegateVotesChanged', {
  195. delegate: holder,
  196. previousBalance: supply,
  197. newBalance: '0',
  198. });
  199. expectEvent(receipt, 'DelegateVotesChanged', {
  200. delegate: holderDelegatee,
  201. previousBalance: '0',
  202. newBalance: supply,
  203. });
  204. expect(await this.token.delegates(holder)).to.be.equal(holderDelegatee);
  205. expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal('0');
  206. expect(await this.token.getCurrentVotes(holderDelegatee)).to.be.bignumber.equal(supply);
  207. expect(await this.token.getPriorVotes(holder, receipt.blockNumber - 1)).to.be.bignumber.equal(supply);
  208. expect(await this.token.getPriorVotes(holderDelegatee, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  209. await time.advanceBlock();
  210. expect(await this.token.getPriorVotes(holder, receipt.blockNumber)).to.be.bignumber.equal('0');
  211. expect(await this.token.getPriorVotes(holderDelegatee, receipt.blockNumber)).to.be.bignumber.equal(supply);
  212. });
  213. });
  214. describe('transfers', function () {
  215. beforeEach(async function () {
  216. await this.token.mint(holder, supply);
  217. });
  218. it('no delegation', async function () {
  219. const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
  220. expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
  221. expectEvent.notEmitted(receipt, 'DelegateVotesChanged');
  222. this.holderVotes = '0';
  223. this.recipientVotes = '0';
  224. });
  225. it('sender delegation', async function () {
  226. await this.token.delegate(holder, { from: holder });
  227. const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
  228. expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
  229. expectEvent(receipt, 'DelegateVotesChanged', { delegate: holder, previousBalance: supply, newBalance: supply.subn(1) });
  230. this.holderVotes = supply.subn(1);
  231. this.recipientVotes = '0';
  232. });
  233. it('receiver delegation', async function () {
  234. await this.token.delegate(recipient, { from: recipient });
  235. const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
  236. expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
  237. expectEvent(receipt, 'DelegateVotesChanged', { delegate: recipient, previousBalance: '0', newBalance: '1' });
  238. this.holderVotes = '0';
  239. this.recipientVotes = '1';
  240. });
  241. it('full delegation', async function () {
  242. await this.token.delegate(holder, { from: holder });
  243. await this.token.delegate(recipient, { from: recipient });
  244. const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
  245. expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
  246. expectEvent(receipt, 'DelegateVotesChanged', { delegate: holder, previousBalance: supply, newBalance: supply.subn(1) });
  247. expectEvent(receipt, 'DelegateVotesChanged', { delegate: recipient, previousBalance: '0', newBalance: '1' });
  248. this.holderVotes = supply.subn(1);
  249. this.recipientVotes = '1';
  250. });
  251. afterEach(async function () {
  252. expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal(this.holderVotes);
  253. expect(await this.token.getCurrentVotes(recipient)).to.be.bignumber.equal(this.recipientVotes);
  254. // need to advance 2 blocks to see the effect of a transfer on "getPriorVotes"
  255. const blockNumber = await time.latestBlock();
  256. await time.advanceBlock();
  257. expect(await this.token.getPriorVotes(holder, blockNumber)).to.be.bignumber.equal(this.holderVotes);
  258. expect(await this.token.getPriorVotes(recipient, blockNumber)).to.be.bignumber.equal(this.recipientVotes);
  259. });
  260. });
  261. // The following tests are a adaptation of https://github.com/compound-finance/compound-protocol/blob/master/tests/Governance/CompTest.js.
  262. describe('Compound test suite', function () {
  263. beforeEach(async function () {
  264. await this.token.mint(holder, supply);
  265. });
  266. describe('balanceOf', function () {
  267. it('grants to initial account', async function () {
  268. expect(await this.token.balanceOf(holder)).to.be.bignumber.equal('10000000000000000000000000');
  269. });
  270. });
  271. describe('numCheckpoints', function () {
  272. it('returns the number of checkpoints for a delegate', async function () {
  273. await this.token.transfer(recipient, '100', { from: holder }); //give an account a few tokens for readability
  274. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('0');
  275. const t1 = await this.token.delegate(other1, { from: recipient });
  276. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('1');
  277. const t2 = await this.token.transfer(other2, 10, { from: recipient });
  278. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('2');
  279. const t3 = await this.token.transfer(other2, 10, { from: recipient });
  280. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('3');
  281. const t4 = await this.token.transfer(recipient, 20, { from: holder });
  282. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('4');
  283. expect(await this.token.checkpoints(other1, 0)).to.be.deep.equal([ t1.receipt.blockNumber.toString(), '100' ]);
  284. expect(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ t2.receipt.blockNumber.toString(), '90' ]);
  285. expect(await this.token.checkpoints(other1, 2)).to.be.deep.equal([ t3.receipt.blockNumber.toString(), '80' ]);
  286. expect(await this.token.checkpoints(other1, 3)).to.be.deep.equal([ t4.receipt.blockNumber.toString(), '100' ]);
  287. await time.advanceBlock();
  288. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('100');
  289. expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber)).to.be.bignumber.equal('90');
  290. expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber)).to.be.bignumber.equal('80');
  291. expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber)).to.be.bignumber.equal('100');
  292. });
  293. it('does not add more than one checkpoint in a block', async function () {
  294. await this.token.transfer(recipient, '100', { from: holder });
  295. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('0');
  296. const [ t1, t2, t3 ] = await batchInBlock([
  297. () => this.token.delegate(other1, { from: recipient, gas: 100000 }),
  298. () => this.token.transfer(other2, 10, { from: recipient, gas: 100000 }),
  299. () => this.token.transfer(other2, 10, { from: recipient, gas: 100000 }),
  300. ]);
  301. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('1');
  302. expect(await this.token.checkpoints(other1, 0)).to.be.deep.equal([ t1.receipt.blockNumber.toString(), '80' ]);
  303. // expectReve(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ '0', '0' ]); // Reverts due to array overflow check
  304. // expect(await this.token.checkpoints(other1, 2)).to.be.deep.equal([ '0', '0' ]); // Reverts due to array overflow check
  305. const t4 = await this.token.transfer(recipient, 20, { from: holder });
  306. expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('2');
  307. expect(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ t4.receipt.blockNumber.toString(), '100' ]);
  308. });
  309. });
  310. describe('getPriorVotes', function () {
  311. it('reverts if block number >= current block', async function () {
  312. await expectRevert(
  313. this.token.getPriorVotes(other1, 5e10),
  314. 'ERC20Votes: block not yet mined',
  315. );
  316. });
  317. it('returns 0 if there are no checkpoints', async function () {
  318. expect(await this.token.getPriorVotes(other1, 0)).to.be.bignumber.equal('0');
  319. });
  320. it('returns the latest block if >= last checkpoint block', async function () {
  321. const t1 = await this.token.delegate(other1, { from: holder });
  322. await time.advanceBlock();
  323. await time.advanceBlock();
  324. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
  325. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  326. });
  327. it('returns zero if < first checkpoint block', async function () {
  328. await time.advanceBlock();
  329. const t1 = await this.token.delegate(other1, { from: holder });
  330. await time.advanceBlock();
  331. await time.advanceBlock();
  332. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  333. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  334. });
  335. it('generally returns the voting balance at the appropriate checkpoint', async function () {
  336. const t1 = await this.token.delegate(other1, { from: holder });
  337. await time.advanceBlock();
  338. await time.advanceBlock();
  339. const t2 = await this.token.transfer(other2, 10, { from: holder });
  340. await time.advanceBlock();
  341. await time.advanceBlock();
  342. const t3 = await this.token.transfer(other2, 10, { from: holder });
  343. await time.advanceBlock();
  344. await time.advanceBlock();
  345. const t4 = await this.token.transfer(holder, 20, { from: other2 });
  346. await time.advanceBlock();
  347. await time.advanceBlock();
  348. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  349. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
  350. expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  351. expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999990');
  352. expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999990');
  353. expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999980');
  354. expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999980');
  355. expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
  356. expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  357. });
  358. });
  359. });
  360. describe('getPastTotalSupply', function () {
  361. beforeEach(async function () {
  362. await this.token.delegate(holder, { from: holder });
  363. });
  364. it('reverts if block number >= current block', async function () {
  365. await expectRevert(
  366. this.token.getPastTotalSupply(5e10),
  367. 'ERC20Votes: block not yet mined',
  368. );
  369. });
  370. it('returns 0 if there are no checkpoints', async function () {
  371. expect(await this.token.getPastTotalSupply(0)).to.be.bignumber.equal('0');
  372. });
  373. it('returns the latest block if >= last checkpoint block', async function () {
  374. t1 = await this.token.mint(holder, supply);
  375. await time.advanceBlock();
  376. await time.advanceBlock();
  377. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber)).to.be.bignumber.equal(supply);
  378. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber + 1)).to.be.bignumber.equal(supply);
  379. });
  380. it('returns zero if < first checkpoint block', async function () {
  381. await time.advanceBlock();
  382. const t1 = await this.token.mint(holder, supply);
  383. await time.advanceBlock();
  384. await time.advanceBlock();
  385. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  386. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  387. });
  388. it('generally returns the voting balance at the appropriate checkpoint', async function () {
  389. const t1 = await this.token.mint(holder, supply);
  390. await time.advanceBlock();
  391. await time.advanceBlock();
  392. const t2 = await this.token.burn(holder, 10);
  393. await time.advanceBlock();
  394. await time.advanceBlock();
  395. const t3 = await this.token.burn(holder, 10);
  396. await time.advanceBlock();
  397. await time.advanceBlock();
  398. const t4 = await this.token.mint(holder, 20);
  399. await time.advanceBlock();
  400. await time.advanceBlock();
  401. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
  402. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
  403. expect(await this.token.getPastTotalSupply(t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  404. expect(await this.token.getPastTotalSupply(t2.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999990');
  405. expect(await this.token.getPastTotalSupply(t2.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999990');
  406. expect(await this.token.getPastTotalSupply(t3.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999980');
  407. expect(await this.token.getPastTotalSupply(t3.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999980');
  408. expect(await this.token.getPastTotalSupply(t4.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
  409. expect(await this.token.getPastTotalSupply(t4.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
  410. });
  411. });
  412. });