Closed nlordell closed 11 months ago
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
I looked into it, and the constructor arguments are not included in the Hardhat deployment data.
I looked into it, and the constructor arguments are not included in the Hardhat deployment data.
We don't have any arguments, do we? There is an "args" field in the artifacts with an empty array.
Also I found this: https://ethereum.stackexchange.com/questions/94396/how-to-get-the-actual-runtime-bytecode-from-creation-bytecode-and-constructor-ar
You can also do an eth_call
to do the comparison. For example, the following command will show no diff:
diff -u --color \
<(cat deployments/localhost/SafeProxyFactory.json | jq '.deployedBytecode') \
<(curl -s "$NODE_URL" -X POST -H 'content-type: application/json' --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"id\":0,\"params\":[{\"data\":$(cat deployments/localhost/SafeProxyFactory.json | jq '.bytecode')}]}" | jq '.result')
We don't have any arguments, do we?
🤦 - correct. For some reason I assumed that the ACCESSOR_SINGLETON
immutable was set from a constructor argument, but it is just read from the transaction context. The difficulty here is that the value for this
that is used to set the immutable value is not easy to fudge.
We don't have any arguments, do we?
🤦 - correct. For some reason I assumed that the
ACCESSOR_SINGLETON
immutable was set from a constructor argument, but it is just read from the transaction context. The difficulty here is that the value forthis
that is used to set the immutable value is not easy to fudge.
Then I'd say it's good as is
Fixes #689
The local verification task does not work correctly for contracts with
immutable
s. This is because,immutable
values get written when the contract's init code executes on-chain, but uses0
place holders in thedeployedBytecode
compiler output.This causes the code that is fetched from the deployed contract to differ slightly from the compiler's byte code output (fetched code has non-0
immutable
values, while the compiler output has 0immutable
values).The fix is to mask the
immutable
s from the fetched code with 0's before comparing.With this fix,
local-verify
script now works for theSimulateTxAccessor
contract: