Describe the bug
If you deploy a UUPS contract, the function fetchIfDifferent returns differences: true in the return object 100% of the time. This is because the transaction it uses to compare the transaction data seems to be the transaction which deployed the proxy contract, not the implementation contract. I would expect to be able to detect differences so I can write a proper skip function and utilize this helper, however because of this issue, it will report changes 100% of the time, regardless of whether contract data actually changed:
Specify a skip function that uses the fetchIfDifferent function to determine whether a deploy script should be skipped.
Deploy the proxy contract
Re-run the same deployment script. Notice that the skip function incorrectly determines there were changes, and will rerun the deployment.
Expected behavior
If the actual implementation contract for a UUPS contract has changed, this should return differences: true. If no data has changed from the implementation contract, it should return differences: false.
This could be likely fixed by checking the deploy options to see if it is a proxy, and if so, use the transaction hash for the implementation contract instead of the proxy contract when fetching the contract data for this comparison.
versions
hardhat-deploy 0.11.24
hardhat 2.12.6
nodejs lts
Additional context
Add any other context about the problem here.
Describe the bug If you deploy a UUPS contract, the function
fetchIfDifferent
returnsdifferences: true
in the return object 100% of the time. This is because the transaction it uses to compare the transaction data seems to be the transaction which deployed the proxy contract, not the implementation contract. I would expect to be able to detect differences so I can write a proper skip function and utilize this helper, however because of this issue, it will report changes 100% of the time, regardless of whether contract data actually changed:https://github.com/wighawag/hardhat-deploy/blob/master/src/helpers.ts#L973
This is the line the check fails at every time.
To Reproduce Steps to reproduce the behavior:
Expected behavior If the actual implementation contract for a UUPS contract has changed, this should return differences: true. If no data has changed from the implementation contract, it should return differences: false.
This could be likely fixed by checking the deploy options to see if it is a proxy, and if so, use the transaction hash for the implementation contract instead of the proxy contract when fetching the contract data for this comparison.
versions
Additional context Add any other context about the problem here.