Skip to content

Conversation

DarkLord017
Copy link
Contributor

@DarkLord017 DarkLord017 commented Sep 12, 2025

Automatic Smart Contract Verification Integration

Resolves #214

This pull request implements automatic smart contract verification across deployment scripts in the service_contracts/tools directory, utilizing the filfox-verifier tool to verify contracts on the Filecoin network. The verification process is controlled via the AUTO_VERIFY environment variable and enhances deployment reliability through automated post-deployment validation.

Changes Made

  • deploy-all-warm-storage-calibnet.sh: Added comprehensive verification for all major contracts and proxy contracts with automatic dependency installation and chain ID detection
  • deploy-registry-calibnet.sh: Integrated verification for both registry implementation and proxy contracts
  • deploy-session-key-registry.sh: Implemented verification for session key registry contract post-deployment
  • deploy-warm-storage-view.sh: Added verification steps for the state view contract
  • deploy-warm-storage-implementation-only.sh: Included verification for warm storage implementation contract

Known Issue

Proxy contract verification encounters an import path error with PDP Proxy:

6 | import {ERC1967Proxy} from "../lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol";

Recommended Fix

Update import statement to use the standardized OpenZeppelin naming convention (@openzeppelin/contracts) to resolve the verification error and ensure compatibility with the filfox-verifier tool.

@DarkLord017
Copy link
Contributor Author

@wjmelements please review

@wjmelements
Copy link
Contributor

Why do you pull the submodules?


pushd "$(dirname $0)/.." >/dev/null
source tools/verify-contracts.sh
CHAIN_ID=314159 verify_contracts_batch "$REGISTRY_IMPLEMENTATION_ADDRESS,src/ServiceProviderRegistry.sol:ServiceProviderRegistry,ServiceProviderRegistry Implementation"
Copy link
Contributor

Choose a reason for hiding this comment

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

The rest of this file should also use $CHAIN_ID

pushd "$(dirname "$0")/.." >/dev/null
source tools/verify-contracts.sh

CHAIN_ID=$CHAIN_ID verify_contracts_batch \
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need CHAIN_ID=$CHAIN_ID.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah it's not exported. maybe it should be

@wjmelements
Copy link
Contributor

For cast args where we are just passing environment variables there are actually ways to use the environment variables more directly. For example

  -r, --rpc-url <URL>
          The RPC endpoint, default value is http://localhost:8545

          [env: ETH_RPC_URL=]

If we called the variable ETH_RPC_URL instead of RPC_URL, we wouldn't need --rpc-url. Another such variable is KEYSTORE. I think there are more.

@DarkLord017
Copy link
Contributor Author

Why do you pull the submodules?

ya sorry will remove that in next commit

@DarkLord017
Copy link
Contributor Author

  -r, --rpc-url <URL>
          The RPC endpoint, default value is http://localhost:8545

          [env: ETH_RPC_URL=]

If we called the variable ETH_RPC_URL instead of RPC_URL, we wouldn't need --rpc-url. Another such variable is KEYSTORE. I think there are more.

okay correcting this

rjan90 and others added 4 commits October 6, 2025 08:59
)

Towards FilOzone#254

We are cutting a set of contracts for the M3 milestone. The price
changes in FilOzone#239 was done with
FilOzone#250 being landed in
mind.

Since FilOzone#250 is not going to land before in M4, I have temporarily
reverted the price changes, so that we keep the price intact for the M3
contract publishing.
Reviewer @rvagg @Kubuxu
Closes FilOzone#257
This should reduce the proof storage growth by a factor of 256.
If the proving period is 1 day, and the deal lasts 1 year, this mapping
will use 2 slots instead of 356.
#### Changes
* Change provenPeriods to bitmap
Reviewer @rvagg
Per a discussion with @jennijuju, we want to make the upgrade process
more transparent.
This changes upgrades to a two step process.
First, we announce the planned upgrade.
Then, after the designated time, we can complete the upgrade.
The delay gives us time to check the pending implementation address. It
also gives users notice even if we are not in communication with them.
I also fix FilOzone#259 in
this change, because I was already adding tests for `upgradeToAndCall`.
I can fix it separately if this change is rejected.
After validating that this is a good design that the team likes, I can
replicate it for the other proxies in separate PRs.
#### Test Plan
I tested the new deployment scripts by running them on calibnet.
*
[announcePlannedUpgrade](https://calibration.filfox.info/en/message/bafy2bzaceb6vpcsy563vhpwig5g6jy7gb6fr2ssxhjgwiagj7k3vbjrg3dg56?t=3)
*
[upgradeToAndCall](https://calibration.filfox.info/en/message/bafy2bzaceadjmlemjyrv7nmwh5lzavdbntjmywvblrzmtuh3wsyldqlvxbcyo?t=3)
#### Changes
* announcePlannedUpgrade
* update _authorizeUpgrade
* new view method for pending upgrade
* make gen
* add and fix tests covering upgradeToAndCall with migrate
* separate announce and upgrade scripts
* update implementation-only script

---------

Co-authored-by: Rod Vagg <[email protected]>
@wjmelements
Copy link
Contributor

I removed some stuff from deploy-warm-storage-implementation-only so there are merge conflicts. I also make its hardcoded CHAIN_ID into a var/param

@DarkLord017
Copy link
Contributor Author

@wjmelements i am currently making the changes , will let u know once ready for review

@DarkLord017
Copy link
Contributor Author

@wjmelements please review , i changed according to this

  -r, --rpc-url <URL>
          The RPC endpoint, default value is http://localhost:8545

          [env: ETH_RPC_URL=]

If we called the variable ETH_RPC_URL instead of RPC_URL, we wouldn't need --rpc-url. Another such variable is KEYSTORE. I think there are more.

okay correcting this

@DarkLord017 DarkLord017 closed this Oct 8, 2025
@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to 🎉 Done in FS Oct 8, 2025
@DarkLord017
Copy link
Contributor Author

please see #272 @wjmelements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Verify smart contracts with chain explorers