Open ddomeke opened 2 months ago
Does anyone have any information on this subject?
To clarify, your issue here is that you can run the code on Polygon mainnet (via remix), but when you run the Solidity code against a forked version of Polygon mainnet you are getting a Hardhat error?
Could you provide the error you are seeing? This could potentially be an issue in our underlying runtime (EDR) during forking.
Hi John,
I use create2 opcode for my minimal proxy contract to make some copy of it.
The error is below
Error: VM Exception while processing transaction: reverted with custom
error 'CloneOpCancelled("Initialization failed")'
at AssetModule.authorized (contracts/apps/common/access/ACL.sol:46)
at AssetModule.cloneAndInitBaseHub
(contracts/apps/main/modules/AssetModule.sol:185)
at AssetModule._defineAssetWithSalt
(contracts/apps/main/modules/AssetModule.sol:161)
at AssetModule.defineAsset
(contracts/apps/main/modules/AssetModule.sol:85)
at App.
at async Proxy.defineAsset
(node_modules\ethers\src.ts\contract\contract.ts:352:16)
at async Context.
when I convert the implementation address to bytes20 then there is no error in Hardhat framework. But, at this time, my contract that works in remix does not work properly. I can not reach the function signature.
Maybe this information gives you an idea about it.
bytes20 impl = bytes20(implementation);
After this change the error like this,
Error: Transaction reverted: function returned an unexpected amount of data
at CollateralModule.depositCollateral
(contracts/apps/main/modules/CollateralModule.sol:156)
at App.
at async Proxy.depositCollateral
(node_modules\ethers\src.ts\contract\contract.ts:352:16)
at async Context.
If it is possible, I want to learn and help you with the EDR and forking issues with your guidance.
Sincerely,
Duran Dömeke
On Mon, Oct 21, 2024 at 2:42 PM John Kane @.***> wrote:
To clarify, your issue here is that you can run the code on Polygon mainnet (via remix), but when you run the Solidity code against a forked version of Polygon mainnet you are getting a Hardhat error?
Could you provide the error you are seeing? This could potentially be an issue in our underlying runtime (EDR) during forking.
— Reply to this email directly, view it on GitHub https://github.com/NomicFoundation/hardhat/issues/5791#issuecomment-2426435459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHHPUUA3AUICPKFY4QDUSDZ4TSDTAVCNFSM6AAAAABPA3AXJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRWGQZTKNBVHE . You are receiving this because you authored the thread.Message ID: @.***>
Hi John, This issue can be related with lsb and msb. create2 can not set implementation address correctly into the bytecode.
Version of Hardhat
2.22.12
What happened?
Minimal reproduction steps
this code works on remix ide on polygon mainnet. but when I use it on polygon mainnet fork for testing it gives initialization fail error. I use another version of assembly code, it passes initialization but could not generate abi correctly.
Search terms
create2 on hardhat