balancer / balancer-v2-monorepo

Balancer V2 Monorepo
https://balancer.fi/
GNU General Public License v3.0
315 stars 382 forks source link

Deploying Balancer Contracts -> ParserError: Expected pragma on @balancer-labs/v2-interfaces && @balancer-labs/v2-solidity-utils #2567

Open 0xEmilio opened 5 months ago

0xEmilio commented 5 months ago

I created a new hardhat project and moved the contracts for weighted pools in.

When I call npx compile, I am met with:

PS C:\Users\---\Documents\programming\---\hardhat> npx hardhat compile
@balancer-labs/v2-interfaces/contracts/solidity-utils/helpers/BalancerErrors.sol:24:1: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum definition.
function _require(bool condition, uint256 errorCode) pure {
^------^

@balancer-labs/v2-solidity-utils/contracts/helpers/ScalingHelpers.sol:35:1: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum definition.
function _upscale(uint256 amount, uint256 scalingFactor) pure returns (uint256) {
^------^

Error HH600: Compilation failed

my hardhat config:


/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: {
    version: "0.7.0",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
    },
  },
};

and deps


        "@balancer-labs/v2-interfaces": "^0.4.0",
        "@balancer-labs/v2-pool-utils": "^4.1.1",
        "@balancer-labs/v2-solidity-utils": "^4.0.0"
      },```

Curious if this is me doing something dumb or if compilation fails due to an actual issue. Thanks.
0xEmilio commented 5 months ago

Seems like the code is not encapsulated, doing do requires refactoring so much.