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

fix: name clashes #887

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .changeset/clean-cameras-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@typechain/ethers-v5': patch
'@typechain/ethers-v6': patch
---

Fix clashes with built-in contract properties
20 changes: 20 additions & 0 deletions contracts/v0.8.9/NameClashes.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pragma solidity ^0.8.7;

contract NameClashes {
address public target;
address public runner;
address public filters;
address public connect;
address public attach;
address public getAddress;
address public getDeployedCode;
address public getFunction;
address public on;
address public off;
address public once;
address public listeners;
address public signer;
address public provider;
address public deployed;
address public then;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
NameClashes,
NameClashesInterface,
} from "../../v0.8.9/NameClashes";

const _abi = [
{
inputs: [],
name: "attach",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "connect",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "deployed",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "filters",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getAddress",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getDeployedCode",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getFunction",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "listeners",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "off",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "on",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "once",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "provider",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "runner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "signer",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "target",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "then",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
] as const;

export class NameClashes__factory {
static readonly abi = _abi;
static createInterface(): NameClashesInterface {
return new utils.Interface(_abi) as NameClashesInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): NameClashes {
return new Contract(address, _abi, signerOrProvider) as NameClashes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export * as rarity from "./Rarity";
export * as nested from "./nested";
export { ISimpleToken__factory } from "./ISimpleToken__factory";
export { Issue552_Reproduction__factory } from "./Issue552_Reproduction__factory";
export { NameClashes__factory } from "./NameClashes__factory";
export { SimpleToken__factory } from "./SimpleToken__factory";
2 changes: 2 additions & 0 deletions packages/target-ethers-v5-test/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export type { KingOfTheHill } from "./v0.8.9/KingOfTheHill/KingOfTheHill";
export { KingOfTheHill__factory } from "./factories/v0.8.9/KingOfTheHill/KingOfTheHill__factory";
export type { Withdrawable } from "./v0.8.9/KingOfTheHill/Withdrawable";
export { Withdrawable__factory } from "./factories/v0.8.9/KingOfTheHill/Withdrawable__factory";
export type { NameClashes } from "./v0.8.9/NameClashes";
export { NameClashes__factory } from "./factories/v0.8.9/NameClashes__factory";
export type { NestedLibrary } from "./v0.8.9/nested/a/NestedLibrary";
export { NestedLibrary__factory } from "./factories/v0.8.9/nested/a/NestedLibrary__factory";
export type { ERC721 } from "./v0.8.9/Rarity/ERC721";
Expand Down
Loading