ERC20VotesComp.test.js 22 KB

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