You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
In the documentation, I noticed that when verifying contracts on Klaytnscope, the contracts need to be flattened. It was mentioned that developers can use Remix for this purpose. Therefore, I want to include an easy Foundry and Hardhat command to simplify the process of flattening a large codebase that will be built on the Klaytn blockchain.
To flatten on Foundry
Flattening a large codebase using Foundry is straightforward. Simply run the command below, and Foundry will automatically create a Contract.flattened.sol file in the src directory. This file will contain all the contracts in the codebase that have been flattened. Use the following command:
Hardhat flattening commands are quite similar to Foundry. You create a file called flatten.sol in the src directory and run the Hardhat command below:
npx hardhat flatten contracts/Contract1.sol > Flattened.sol
If you have multiple contracts that are not dependent on each other, you can run this command:
Proposal
In the documentation, I noticed that when verifying contracts on Klaytnscope, the contracts need to be flattened. It was mentioned that developers can use Remix for this purpose. Therefore, I want to include an easy Foundry and Hardhat command to simplify the process of flattening a large codebase that will be built on the Klaytn blockchain.
To flatten on Foundry
Flattening a large codebase using Foundry is straightforward. Simply run the command below, and Foundry will automatically create a
Contract.flattened.sol
file in thesrc
directory. This file will contain all the contracts in the codebase that have been flattened. Use the following command:forge flatten --output src/Contract.flattened.sol src/Contract.sol
To flatten on Hardhat
Hardhat flattening commands are quite similar to Foundry. You create a file called flatten.sol in the src directory and run the Hardhat command below:
npx hardhat flatten contracts/Contract1.sol > Flattened.sol
If you have multiple contracts that are not dependent on each other, you can run this command:
npx hardhat flatten contracts/Contract1.sol contracts/Contract2.sol > Flattened.sol
The text was updated successfully, but these errors were encountered: