-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replacing the toolbox plugin with hardhat-zksync and introducin… (
#970) * feat: replacing the toolbox plugin with Hardhat-ZKSync and introducing new tasks for deploying, upgrading and verifying contracts * fix: update tests to work * fix: add initializer function as option, update readme and fix address for ethers-v5 * Revert "fix: add initializer function as option, update readme and fix address for ethers-v5" This reverts commit b9cd5c6. * fix: add initializer function as option, update readme and fix address for ethers-v5 * fix: rename task names, change readme files and update tasks with deployment type * chore: update readme files * fix: mock setDeploymentType function inside deployer * fix: update task arguments * fix: remove chai-matchers from the plugin list * fix: dont compile when verify contracts * chore: update readme files * chore: update readme files --------- Co-authored-by: Marko Arambasic <makiarambasic@gmail.com>
- Loading branch information
1 parent
87504e8
commit 286c50d
Showing
48 changed files
with
1,593 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const TASK_DEPLOY_ZKSYNC = 'deploy-zksync'; | ||
export const TASK_DEPLOY_ZKSYNC_LIBRARIES = 'deploy-zksync:libraries'; | ||
export const TASK_DEPLOY_ZKSYNC_CONTRACT = 'deploy-zksync:contract'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as chai from 'chai'; | ||
import sinon from 'sinon'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { expect } from 'chai'; | ||
import sinonChai from 'sinon-chai'; | ||
import { deployContract } from '../../src/plugin'; | ||
|
||
chai.use(sinonChai); | ||
|
||
describe('deployWithContract', () => { | ||
const sandbox = sinon.createSandbox(); | ||
let hre: HardhatRuntimeEnvironment; | ||
const artifact = { | ||
sourceName: 'contracts/MyContract.sol', | ||
contractName: 'MyContract', | ||
}; | ||
|
||
beforeEach(() => { | ||
hre = { | ||
deployer: { | ||
loadArtifact: sandbox.stub().resolves(artifact), | ||
deploy: sandbox.stub().resolves({ | ||
getAddress: async () => '0x1234567890123456789012345678901234567890', | ||
abi: [], | ||
}), | ||
setDeploymentType: sandbox.stub().resolves(), | ||
}, | ||
run: sandbox.stub(), | ||
} as any; | ||
}); | ||
|
||
afterEach(() => { | ||
sandbox.restore(); | ||
}); | ||
|
||
const taskArgs = { | ||
contractName: 'MyContract', | ||
constructorArgsParams: [], | ||
constructorArgs: undefined, | ||
noCompile: false, | ||
}; | ||
|
||
it('should deploy the contract with compile', async () => { | ||
await deployContract(hre, taskArgs); | ||
|
||
expect(hre.deployer.deploy).to.have.been.callCount(1); | ||
expect(hre.deployer.setDeploymentType).to.have.been.callCount(1); | ||
expect(hre.run).to.have.been.callCount(1); | ||
}); | ||
|
||
it('should deploy the contract without compile', async () => { | ||
taskArgs.noCompile = true; | ||
await deployContract(hre, taskArgs); | ||
expect(hre.run).to.have.been.callCount(0); | ||
expect(hre.deployer.deploy).to.have.been.callCount(1); | ||
expect(hre.deployer.setDeploymentType).to.have.been.callCount(1); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.