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

AP-763: Remove redundant imports related to AccountsCreateEndowment + fix pragma version #386

Merged
merged 3 commits into from
Sep 26, 2023
Merged
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
2 changes: 1 addition & 1 deletion contracts/core/accounts/facets/AccountsCreateEndowment.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity 0.8.19;
Copy link
Contributor Author

@0xNeshi 0xNeshi Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out Tenderly and/or Polygonscan can compile their own version of the contract submitted for verification.
Fixing pragma version in place ensured that neither of them are able to use a compiler version different from the original.

The weirdest thing is that this compiler mismatch issue occurs randomly - for example the original AccountsCreateEndowment wasn't verifiable at all due to this error, but a slight modification would make it so, after which another modification would make it not so etc.
Even changes in this PR were causing the same issue to appear, but locking the pragma made it go away.

For more details see https://swcregistry.io/docs/SWC-103/#remediation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevieraykatz @SovereignAndrey we don't have to do this for other contracts for now, but if verification fails for any of them, this might be the culprit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad it was easy to diagnose. I find it quite strange that polyscan/tenderly might use another compiler version when the later version 0.8.20+ are all unsupported by Polygon... -___-

Good find and good change

Copy link
Contributor Author

@0xNeshi 0xNeshi Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevieraykatz

the later version 0.8.20+ are all unsupported by Polygon

I found the official docs that confirm that it's recommended to use <=0.8.19, but it might not mean that later versions can't be used at all to compile contracts 🤔 Maybe leaving pragma open makes these polygonscan/tenderly compilers able to use later Solidity versions nonetheless

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Alchemy RPCs straight up reject contracts on later versions! Though that might just be a nice feature and not reflected in other RPC validation steps.


import {LibAccounts} from "../lib/LibAccounts.sol";
import {Validator} from "../../validator.sol";
Expand Down