As side note, I also know what arguments were used to deploy the contract inside the factory, but I do not understand how should i hash those to pass to hardhat-etherscan verifiy task

Jun 10, 2022, 9:29 AM
hm, the function deployed them with
new Proxy(arg1, arg2,arg3)

I am not sure what opcode was used here
Jun 10, 2022, 9:30 AM
Isn't the plugin auto detecting constructor args?
Jun 10, 2022, 9:31 AM
You mean I could just run
npx hardhat verify --network theNetwork CONTRACT_ADDRESS

without passing it arguments and it would be verified?
I will try now but I am not sure it will work
Jun 10, 2022, 9:32 AM
It should. Usually they auto detect
Jun 10, 2022, 9:32 AM
Ok, let me see
Nope, it sais that the constructor for this contract has 3 parameters but 0 were provided
Jun 10, 2022, 9:34 AM
Then go to abi.hashex.org
Paste abi, paste constructor args and get encoded data
Jun 10, 2022, 9:35 AM
I'll try to use it again, last time I couldn't wrap my head around it.

What I will receive is a lengthy bytecode?...

What do I do with that then? pass to verify function or should I devide it?
Jun 10, 2022, 9:36 AM
You'll get the abi encoded version of constructor args
Pass that to hardhat plugin while verifying
Flag is --forceConstructor or something. Check docs
Jun 10, 2022, 9:38 AM
Will do and update here with results. Thank you, @grimreaper619 !
hm, it sais that --forceConstructor is an invalid parameter, tried with all lowercase too, didn't help
npx hardhat verify --network arbitrum_testnet 0x1656FBcC18139F0f1e3a9B3181250E9563b2E156 --forceConstructor "0000000000000000000000007e3fda19770d5c7d57a51b3c63a464f62e6d590500000000000000000000000000000000000000000000000000000000000000600000000000000000000000003cc33738dfb198e43729bd1b38e57a0caf85ac240000000000000000000000000000000000000000000000000000000000000000"
Is there sometyhing wrong woth the way I do that?
Jun 10, 2022, 9:44 AM
It may not be forceConstructor. Check their docs
I don't remember it correct
Jun 10, 2022, 9:45 AM
will do
Hm, seems like the contract that was deployed by the factory has no ABI. It was deployed yesterday and the factory contract could return address of the deployed contract.

trying to verify the contract by hand in therscan it told me that there was no such contract eventhough I can see the transaction to this address.
Hardhat-etherscan also tells me that no bytecode was found the address

These contracts were tested locally.

Any idea what could cause this problem?
This is the function that deploys a contract.

BTW, it is on the arbitrum testnet, but AFAIK there were no changes to opcodes that deploy contracts
Jun 10, 2022, 10:44 AM
where is the initialize part
Jun 10, 2022, 10:45 AM
Should it be initialized asap? Initialize is called later

Another proxy contracts that were deployed by hand (not through a factory) that were not initialized from the start could be verified without a problem
If you know something I don't, please share
Jun 10, 2022, 10:47 AM
if you don't initalize that contract is empty
usually you have to do it asap
Jun 10, 2022, 10:48 AM
hm, it should have been initialized in the deploy script... Now I know it wasn't.

@grimreaper619 , @FreezyDev Thank you for provided information, it really is helpfull!

Will work on that issue
Jun 10, 2022, 10:49 AM
🤙🤙
Jun 10, 2022, 10:50 AM
It was actually initialized.

But what is strange, for proxies that were deployed by hand I can also see that there were 2 transactions.

First is contract createion and only then initialization.

For the contract that was deployed through a proxy I can only see initialization. By the way I've deployed another contract and it's too can not be verified due to abscence of bytecode and it too was initialized.
I assume I am deploying contract inside the factory in a wrong way.. Why then it worked in local tests..?
Jun 10, 2022, 11:01 AM
when I use factory pattern, I only need to verify the implementation
Jun 10, 2022, 11:01 AM
You've told me this yesterday, tho implementation is already verified.

Hm, ok then I will see what I can do, if nothing, then I will raise this issue again later
Jun 10, 2022, 11:05 AM
ok
Jun 10, 2022, 11:52 AM

© 2024 Draquery.com All rights reserved.