-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create2 code works on remix but don't work on hardhat #5791
Comments
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.<fallback> (contracts/apps/main/abstracts/Modular.sol:86)
at EdrProviderWrapper.request
(node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:428:41)
at async HardhatEthersSigner.sendTransaction
***@***.***\hardhat-ethers\src\signers.ts:125:18)
at async send (node_modules\ethers\src.ts\contract\contract.ts:313:20)
at async Proxy.defineAsset
(node_modules\ethers\src.ts\contract\contract.ts:352:16)
at async Context.<anonymous> (test\CollateralModule.test.ts:369:20)
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.<fallback> (contracts/apps/main/abstracts/Modular.sol:86)
at EdrProviderWrapper.request
(node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:428:41)
at async HardhatEthersSigner.sendTransaction
***@***.***\hardhat-ethers\src\signers.ts:125:18)
at async send (node_modules\ethers\src.ts\contract\contract.ts:313:20)
at async Proxy.depositCollateral
(node_modules\ethers\src.ts\contract\contract.ts:352:16)
at async Context.<anonymous> (test\CollateralModule.test.ts:659:21)
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
<#5791 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGHHPUUA3AUICPKFY4QDUSDZ4TSDTAVCNFSM6AAAAABPA3AXJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRWGQZTKNBVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi John, |
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
The text was updated successfully, but these errors were encountered: