Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed toInstance in Truffle Adapter #47

Merged
merged 4 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It is also **mandatory** to specify the naming convention for migrations such as
## Tasks

- `migrate` task, which allows you to deploy and automatically verify contracts.
<!-- - `migrate:verify` task, which helps you verify already deployed contracts. -->
- `migrate:verify` task, which helps you verify already deployed contracts.

> :warning: **Hardhat Config**: Make sure they are follow the docs from `@nomicfoundation/hardhat-verify`.

Expand Down Expand Up @@ -80,7 +80,8 @@ module.exports = {
skip: -1,
wait: 1,
verify: false,
attempts: 0,
verifyParallel: 1,
verifyAttempts: 3,
pathToMigrations: "./deploy",
force: false,
continue: false,
Expand All @@ -96,7 +97,8 @@ module.exports = {
- `skip`: The number of migration to skip. **Overrides only parameter.**
- `wait` : The number of confirmations to wait for after the transaction is mined.
- `verify` : The flag indicating whether the contracts should be verified.
- `attempts`: The number of attempts to verify the contract.
- `verifyParallel` : The size of the batch for verification.
- `verifyAttempts` : The number of attempts to verify the contract.
- `pathToMigrations` : The path to the folder with the specified migrations.
- `force` : The flag indicating whether the contracts compilation is forced.
- `continue` : The flag indicating whether the deployment should restore the state from the previous deployment.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solarity/hardhat-migrate",
"version": "2.0.0-alpha.4",
"version": "2.0.0-alpha.5",
"description": "Automatic deployment and verification of smart contracts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/deployer/adapters/TruffleAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ export class TruffleAdapter extends Adapter {
);
}

public async toInstance<I>(instance: TruffleFactory<I>, address: string): Promise<I> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async toInstance<I>(instance: TruffleFactory<I>, address: string, _: OverridesAndMisc): Promise<I> {
const contract = this._hre.artifacts.require(instance.contractName!);

await this._overrideConnectMethod(instance);
await this._overrideConnectMethod(contract);

return contract.at(address);
}
Expand Down