Professional Documents
Culture Documents
The smart contract is the software program implementing a set of rules or condition and
operates blockchain
This set of rules are used by different parties to the smart contract to transfer the digital assets
between them. A smart contract is a self-executing program based on if-then logic.
For example, vending machines are a ubiquitous presence in everyday life. It's also a simple
model of a smart contract: If someone inserts $2 and then presses B4, then the machine
dispenses the package of cookies held in the B4 slot. In other words, if the vending machine
receives the required item of value, it performs the requested action
What is metamask?
Metamask is a browser plugin that hold an ethereum wallet and connects the computer with the
ethereum network. It can connect and network with other providers who offer free others to
accounts created in wallets of metamask.for instance an account created in metamask can be
connected with an external network named ropsten test network which can then inject free
ethers to a corresponding account
Demonstrate how to create and initialize dynamic arrays using any example in solidity?
In solidity to declare an array of dynamic size the programmer has to specify the type of the
elements as follows:
type[]arrayName;
Dynamic memory arrays are created using new keyboard
unit size = 3;
unit account[] = new unit[](size);
Following single statement initializes Solidity array elements
unit account[3] = [10,20,30];
Following is an example to assign a single element of the array:
account[2]=5;
Following is an example to assign element no 3rd in the array a value of 5
unit salary = account [2];
The above statement assigns the value of third element in array to salary value