FLATTEN a Smartcontrat before deploy?

Hello everyone

do we need to Flatten a Smartcontrat before to deploy it?

what about the etherscan verify? i will need to put the flattened one when i fill the form?

thx

war57

1 Like

You don't need to flatten it before deployment.
You can however easily verify your contract via etherscan-like explorers by using the "Solidity (Single file)" option and then pasting the flattened contract.

it seems i was doing this way on my other project, and it was jsut impossible to verifying the project

It keep saying me that the ABI do not match ....

Any idea?

1 Like

I've experienced random issues too, only with *.etherscan and newer solidity compilers.
Use remix flattener, and try using solidity versions <=0.8.9 ...

so to be sure to understand:

1/ i deploy first my "Unflatened " contract,

2/ After it is deployed, i go back to remix and Flaten it, to get the ABI + Flatened version of contract

3/ Then i go on etherscan-Like website, and i past it??

All is correct?

When you talk about the solidity, i need to use the last one? 8.13 actually

Correct.

Use whatever fits your project best, Im just suggesting to use an earlier version if you have problems verifying on *.etherscan explorers.

thanks for help bro :hugs::+1:

1 Like

You can also use hardhat ehterscan or truffle verify to verify an un-flattened contract easily

npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"

truffle run verify SimpleStorage --network rinkeby