Open bahricanyesil opened 1 year ago
Hey @bahricanyesil, wondering if you've figured this out
Any ideas @nikola-bozin-org?
You would need to use contract-flattener/solidity-flattener and than import that whole flattened/solidity-contract for compilation.
Quick note, there are no client-side contract-flattener's as of my knowledge. You would have to do it manually or make your script.
if you have for example contract1 = ...
and contract2 = ...
but contract 2 imports contract1, you would just do this:
contract2.replace('import "./Contract1.sol";',contract1)
.
But also make sure to exclude first two lines for licence and solidity version from atlest one contract.
Ofc, this is a quick solution, but a more robust solution is required if dealing with more complex contracts.
I see, thank you for the extra info :)
Hey @bahricanyesil, wondering if you've figured this out
Any ideas @nikola-bozin-org?
As @nikola-bozin-org said, I've replaced the import statements with the actual contract codes.
How can I compile a smart contract which imports other files or packages?
For example: "import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"