generated from nicobevilacqua/hardhat-solidity-typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path03-ChooseANickname.test.ts
35 lines (27 loc) · 923 Bytes
/
03-ChooseANickname.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { expect } from 'chai';
import { Contract } from 'ethers';
import { ethers } from 'hardhat';
describe('DeployAContract', () => {
let deployer: SignerWithAddress;
let attacker: SignerWithAddress;
let captureTheEther: Contract;
let target: Contract;
before(async () => {
[attacker, deployer] = await ethers.getSigners();
captureTheEther = await (
await ethers.getContractFactory('CaptureTheEther', attacker)
).deploy(attacker.address);
await captureTheEther.deployed();
target = await (
await ethers.getContractFactory('NicknameChallenge')
).attach(await captureTheEther.playerNicknameContract(attacker.address));
target = target.connect(attacker);
});
it('exploit', async () => {
/**
* YOUR CODE HERE
* */
expect(await target.isComplete()).to.equal(true);
});
});