This is Day 3
of 30
in Solidity Series
Today I Learned About Initializing a Smart Contract in Solidity.
Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met. They typically are used to automate the execution of an agreement so that all participants can be immediately certain of the outcome, without any intermediary’s involvement or time loss. They can also automate a workflow, triggering the next action when conditions are met.
contract ContractName {
Statement1;
Statement2;
}
It is Recommended to use Pascal case Notation for the Contract Name, you should capitalize first letter of each word in the contract name. eg -
MyContract
SendFunds
MintNft
Top comments (1)
If you have state variables in your contract, you can use constructor as an alternative to initialize them. Here is an example from Smart Contract Engineer channel. Enjoy and have fun!