On completion of this lesson,
you will be able to explain the address of a smart contract,
list the compilation artifacts generated by the compiler,
byte code, ABI, web3deploy script,
function hashes, and gas estimates.
A smart contract can be created,
on behalf of an externally owned account,
by application programmatically from the command-line interface and
by a script of commands from high level applications and user interface or UI.
It can also be created from inside a smart contract.
We'll cover this approach in a later course.
We need an address for the smart contract to deploy it and invoke its functions.
The address is computed by hashing
the account number of externally owned account UI and the nonce.
Let us review these steps with the Greeter smart contract on Remix.
Let's go back to the Greeter.sol and find out
how the compiler provides you many artifacts.
I'm going to compile,
and then click on the Details button,
and you can see there is the name of the contract,
the metadata of the contract,
the byte code of the smart contract that executes on
the Ethereum virtual machine.
The Application Binary Interface is here,
and if we can expand on it,
you can see the various details.
Web3deploy script is here.
This is used by the web application to interface to
the smart contract and the metadata hash.
There are few other details.
The function hashes, the hashes by which the functions are called,
and the gas estimates when the functions are executed,
and the runtime bytecode,
and then the assembly code.
As you can see, a contract needs to be compiled.
Various artifacts are generated including;
the bytecode for deploying the contract,
and the Application Binary Interface,
ABI for the application that smart contract interact with a deployed bytecode.
Remix compiler script generates many artifacts in one shot.
You can view these items generated by clicking on the Compile button,
and then the Details button just below the Compile button.
A pop-up screen appears with many details.
Here are some of the artifacts generated by
the Remix smart contract compile process and their use.
ABI, Application Binary Interface,
the interface schema for a transaction to
invoke functions on the smart contract instance bytecode.
Contract bytecode, this is the bytecode that is
executed for instantiating a smart contract on the EVM.
Think of it like executing a constructor of a smart contract to create an object.
WebDeploy script, this as two items;
json script to web application to invoke smart contract function,
script for programmatically deploying a smart contract from a web application.
Gas estimates, this provides a gas estimates for
deploying the smart contract and for the function invocation.
Function hashes, first four byte of
the function signatures to facilitate function invocation by a transaction.
Instance bytecode, the bytecode of the smart contract instance.
We will learn more about these and how to use them in
building blockchain application in the upcoming lessons.
Summarizing, Remix solidity compiler generate several artifacts as discussed.
Here are some important ones: name of the contract,
bytecode executed for the contract creation on the EVM, ABI,
Application Binary Interface, details functions,
parameters and return values,
Web3 deploy module that provide
the script for invoking the smart contract from web application,
gas estimates for execution of a function,
actual run-time bytecode of the smart contract.
Explore this list on Remix ID.
If you have Remix window open and the smart contract in it,
click the Compile, and then, the Details button.