Rari-Capital / fuse-v1

Smart contracts for Fuse V1 by Rari Capital.
Other
3 stars 3 forks source link

Generates invalid interfaces, formatter throws that it can't parse the AST #10

Closed zerosnacks closed 2 years ago

zerosnacks commented 2 years ago

From compound-protocol (core)

Could not find artifact `ComptrollerStorage` in the compiled artifacts
Could not find artifact `CTokenInterfaces` in the compiled artifact
 Could not find artifact `ErrorReporter` in the compiled artifacts

From fuse-contracts (root)

[error] generated/interfaces/IFusePoolDirectory.sol: Error: extraneous input '(' expecting {'from', ')', 'error', 'function', 'address', 'mapping', 'calldata', 'revert', 'var', 'bool', 'string', 'byte', 'callback', Int, Uint, Byte, Fixed, Ufixed, 'leave', 'payable', 'constructor', 'receive', Identifier} (18:50)
[error] generated/interfaces/IFusePoolLens.sol: Error: The specified node does not exist
[error] generated/interfaces/IFusePoolLensSecondary.sol: Error: extraneous input '(' expecting {'from', 'error', 'function', 'address', 'mapping', 'calldata', 'revert', 'var', 'bool', 'string', 'byte', 'callback', Int, Uint, Byte, Fixed, Ufixed, 'leave', 'payable', 'constructor', 'receive', Identifier} (7:95)
zerosnacks commented 2 years ago

From compound-protocol (core)

  • ComptrollerStorage
Could not find artifact `ComptrollerStorage` in the compiled artifacts
  • CTokenInterfaces
Could not find artifact `CTokenInterfaces` in the compiled artifact
  • ErrorReporter
 Could not find artifact `ErrorReporter` in the compiled artifacts
  • RewardsDistributorStorage
Could not find artifact `RewardsDistributorStorage` in the compiled artifacts

From fuse-contracts (root)

  • FusePoolDirectory
[error] generated/interfaces/IFusePoolDirectory.sol: Error: extraneous input '(' expecting {'from', ')', 'error', 'function', 'address', 'mapping', 'calldata', 'revert', 'var', 'bool', 'string', 'byte', 'callback', Int, Uint, Byte, Fixed, Ufixed, 'leave', 'payable', 'constructor', 'receive', Identifier} (18:50)
  • FusePoolLens
[error] generated/interfaces/IFusePoolLens.sol: Error: The specified node does not exist
  • FusePoolLensSecondary
[error] generated/interfaces/IFusePoolLensSecondary.sol: Error: extraneous input '(' expecting {'from', 'error', 'function', 'address', 'mapping', 'calldata', 'revert', 'var', 'bool', 'string', 'byte', 'callback', Int, Uint, Byte, Fixed, Ufixed, 'leave', 'payable', 'constructor', 'receive', Identifier} (7:95)

I was able to work around these for now.

For FusePoolDirectory, FusePoolLens and FusePoolLensSecondary it appears the code generation is incorrect. As a temporary workaround I have used https://gnidan.github.io/abi-to-sol/ with some small modifications.

The other contracts are abstracts without a constructor or no implementation.

Closing this as I don't see any real action points other than filing upstream bug reports.