Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Abigen fails for identifier named _100pct #967

Closed
meetmangukiya opened this issue Feb 26, 2022 · 0 comments · Fixed by #970
Closed

Abigen fails for identifier named _100pct #967

meetmangukiya opened this issue Feb 26, 2022 · 0 comments · Fixed by #970
Labels
bug Something isn't working

Comments

@meetmangukiya
Copy link
Contributor

Version

├── ethers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   ├── ethers-addressbook v0.1.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   ├── ethers-contract v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   ├── ethers-contract-abigen v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-contract-derive v0.6.0 (proc-macro) (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-contract-abigen v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-providers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   ├── ethers-etherscan v0.2.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-solc v0.2.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   ├── ethers-middleware v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   ├── ethers-contract v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-etherscan v0.2.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-providers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   │   ├── ethers-signers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01)
│   │   │   ├── ethers-core v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   ├── ethers-providers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   ├── ethers-signers v0.6.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)
│   └── ethers-solc v0.2.0 (https://github.com/gakonst/ethers-rs#faba6e01) (*)                                                                                                                                          

Platform

Darwin Meets-Mac-mini.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64

Description

Abigen fails for identifier named _100pct. I am guessing this has to do with the particular case of _ followed by a number. The transforming logic probably eliminates the _ and starts with whatever is next, in this case, the digit which becomes an invalid identifier. 10_0pct_ was the ident generated for _100pct.

I tried this code:

{
  "inputs": [],
  "name": "_100pct",
  "outputs": [
    {
      "internalType": "uint256",
      "name": "",
      "type": "uint256"
    }
  ],
  "stateMutability": "view",
  "type": "function"
},
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant