Skip to content

Commit e15b8c4

Browse files
authored
build: use the official typechain ethers-v5 library (#239)
* build: use the official typechain ethers-v5 library
1 parent df1e51a commit e15b8c4

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@nomiclabs/buidler-etherscan": "^1.3.3",
2121
"@nomiclabs/buidler-waffle": "^2.0.0",
2222
"@openzeppelin/contracts": "3.0.1",
23+
"@typechain/ethers-v5": "0.0.2",
2324
"@types/bs58": "^4.0.1",
2425
"@types/dotenv": "^8.2.0",
2526
"@types/minimist": "^1.2.0",
@@ -55,7 +56,6 @@
5556
"ts-generator": "0.0.8",
5657
"ts-node": "^8.10.1",
5758
"typechain": "^2.0.0",
58-
"typechain-target-abarmat-ethers-v5": "^1.0.0",
5959
"typescript": "^3.9.3",
6060
"yaml": "^1.10.0",
6161
"yargs": "^15.3.1"
@@ -82,7 +82,7 @@
8282
"prettier:sol": "prettier --write 'contracts/*.sol'",
8383
"flatten": "scripts/flatten",
8484
"abi:extract": "truffle-abi -d ./build/contracts -o ./build/abis/ -v",
85-
"typechain": "typechain --target abarmat-ethers-v5 --outDir build/typechain/contracts 'build/abis/*.json'",
85+
"typechain": "typechain --target ethers-v5 --outDir build/typechain/contracts 'build/abis/*.json'",
8686
"verify": "buidler verify"
8787
},
8888
"lint-staged": {

test/lib/channel.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class MiniCommitment {
309309
return {
310310
to: ctdt.address,
311311
value: 0,
312-
data: ctdt.interface.encodeFunctionData('executeWithdraw(address,bytes32,bytes,bytes)', [
312+
data: ctdt.interface.encodeFunctionData('executeWithdraw', [
313313
withdrawInterpreterAddress,
314314
randomBytes(32), // nonce
315315
encode(withdrawOutcomeEncoding, { to: recipient, amount: BigNumber.from(amount) }),
@@ -344,16 +344,13 @@ export class MiniCommitment {
344344
return {
345345
to: ctdt.address,
346346
value: 0,
347-
data: ctdt.interface.encodeFunctionData(
348-
'executeEffectOfInterpretedAppOutcome(address,bytes32,bytes32,address,bytes)',
349-
[
350-
mockDispute.address,
351-
freeBalanceIdentityHash,
352-
appIdentityHash,
353-
interpreterAddr,
354-
encodedParams,
355-
],
356-
),
347+
data: ctdt.interface.encodeFunctionData('executeEffectOfInterpretedAppOutcome', [
348+
mockDispute.address,
349+
freeBalanceIdentityHash,
350+
appIdentityHash,
351+
interpreterAddr,
352+
encodedParams,
353+
]),
357354
operation: MultisigOperation.DelegateCall,
358355
}
359356
}
@@ -369,10 +366,11 @@ export class MiniCommitment {
369366
return {
370367
to: ctdt.address,
371368
value: 0,
372-
data: ctdt.interface.encodeFunctionData(
373-
'executeEffectOfFreeBalance(address,bytes32,address)',
374-
[mockDispute.address, freeBalanceIdentityHash, interpreterAddr],
375-
),
369+
data: ctdt.interface.encodeFunctionData('executeEffectOfFreeBalance', [
370+
mockDispute.address,
371+
freeBalanceIdentityHash,
372+
interpreterAddr,
373+
]),
376374
operation: MultisigOperation.DelegateCall,
377375
}
378376
}
@@ -409,10 +407,13 @@ export class MiniCommitment {
409407
// Encode call to execute transaction
410408
const multisig = new Interface(MultisigArtifact.abi)
411409

412-
const txData = multisig.encodeFunctionData(
413-
'execTransaction(address,uint256,bytes,uint8,bytes[])',
414-
[details.to, details.value, details.data, details.operation, signatures],
415-
)
410+
const txData = multisig.encodeFunctionData('execTransaction', [
411+
details.to,
412+
details.value,
413+
details.data,
414+
details.operation,
415+
signatures,
416+
])
416417

417418
return { to: this.multisigAddress, value: 0, data: txData }
418419
}

test/lib/deployment.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,7 @@ export async function deployMultisigWithProxy(
251251
} = ctx
252252
const tx = await proxyFactory.functions.createProxyWithNonce(
253253
masterCopy.address,
254-
masterCopy.interface.encodeFunctionData('setup(address[])', [
255-
owners.map((owner) => owner.address),
256-
]),
254+
masterCopy.interface.encodeFunctionData('setup', [owners.map((owner) => owner.address)]),
257255
// hardcode ganache chainId
258256
solidityKeccak256(['uint256', 'uint256'], [4447, 0]),
259257
)

0 commit comments

Comments
 (0)