Compiling contracts
Solidity is a high-level programming language we can understand but an EVM can't. An EVM understands instructions written in the contract in the form of bytecode generated after contract compilation.
After the compilation of any contract, the compiler returns a JSON file containing two main parts
ABI - Application binary interface describes smart contract methods and functions.
Bytecode - it contains instructions to EVM in the form of binary.
Compile smart contracts using Hardhat
Hardhat is a development environment that facilitates building on Ethereum. It helps developers manage and automate the recurring tasks that are inherent to the process of building smart contracts and dApps, and it allows you to easily introduce more functionality around this workflow.
To compile contracts using the Hardhat development environment we recommend you follow this page:
Compile smart contracts using Remix IDE
Remix IDE is one the most popular web-based code editor to write smart contracts. you can also use compiled contracts from Remix IDE in Ethcode for contract deployment and contract method calls.
Compile smart contract on Remix IDE.
After compilation copy the JSON file of your compiled contract from
artifacts/ContractName_metadata.json
After copying create a new folder named
artifacts
and then create a subfoldercontracts.
create a new file in the
contracts
folder<contractName>.json
paste the content copied from RemixIDE in
<contractName>.json
file.
Last updated