Skip to content

Commit

Permalink
Adjust extract task to use minimal compiler input
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Jul 29, 2024
1 parent 69ad9a3 commit caf76f4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "hardhat test",
"coverage": "hardhat coverage",
"deploy": "yarn hardhat deploy",
"mastercopy:extract": "yarn hardhat mastercopy:extract",
"mastercopy:extract": "yarn run build && yarn hardhat mastercopy:extract",
"mastercopy:deploy": "yarn hardhat mastercopy:deploy --network",
"mastercopy:verify": "yarn hardhat mastercopy:verify --network",
"prepack": "yarn run clean && yarn run build",
Expand Down
6 changes: 3 additions & 3 deletions tasks/mastercopy-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ task(
'For every version entry on the artifacts file, deploys a mastercopy into the current network'
).setAction(async (_, hre) => {
const [signer] = await hre.ethers.getSigners()
const provider = createEIP1193(hre.network.provider, signer)

await deployMastercopies({ provider })
await deployMastercopies({
provider: createEIP1193(hre.network.provider, signer),
})
})

function createEIP1193(
Expand Down
40 changes: 19 additions & 21 deletions tasks/mastercopy-extract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { task, types } from 'hardhat/config'
import { task } from 'hardhat/config'

import { extractMastercopyArtifact } from 'zodiac-core'

Expand All @@ -8,25 +8,23 @@ const AddressOne = '0x0000000000000000000000000000000000000001'

task(
'mastercopy:extract',
'Extracts current mastercopy build artifacts, and persists it'
)
.addParam(
'mastercopyVersion',
'The extracted artifact version',
undefined,
types.string,
true
)
.setAction(async (params) => {
const version = params.mastercopyVersion || packageJson.version
'Extracts and persists current mastercopy build artifacts'
).setAction(async (_, hre) => {
const contractVersion = packageJson.version
const contractName = 'Delay'
const contractSource = 'contracts/Delay.sol'
const compilerInput = await hre.run('verify:etherscan-get-minimal-input', {
sourceName: contractSource,
})

extractMastercopyArtifact({
version,
contractName: 'Delay',
constructorArgs: {
types: ['address', 'address', 'address', 'uint256', 'uint256'],
values: [AddressOne, AddressOne, AddressOne, 0, 0],
},
salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
})
extractMastercopyArtifact({
contractVersion,
contractName,
compilerInput,
constructorArgs: {
types: ['address', 'address', 'address', 'uint256', 'uint256'],
values: [AddressOne, AddressOne, AddressOne, 0, 0],
},
salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
})
})

0 comments on commit caf76f4

Please sign in to comment.