Raj DPatel BTPractical 2
Raj DPatel BTPractical 2
Practical - 2
Aim: To write, deploy, and execute a basic smart contract that makes
use of different data types in Solidity.
Software Used:
1) Remix IDE 0.53.1
2) Windows 11
3) Solidity 0.8.20
Description:
● We are going to demonstrate different data types in Solidity and their
uses along with some Special Data types used only for solidity.
● First of all, let’s start by writing down different data types in the solidity
file and understand how they work and how they can be used.
● Then, we’ll deploy them on remix testnet and understand how the
smart contract deployment looks like.
Contract Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract RajDPatel2 {
UTU/CGPIT/CE/SEM-7/Blockchain Technology
Enrollment No: 202103103510081 Date:23/8/2024
// Boolean
bool public raj_10 = false;
// Strings
string public raj_11 = "PATEL96";
//Address
// to store the address of any wallet or any contract this data type in used.
// It is a string of 40 hexadecimal values.
address public raj_12 = 0x039CA860A762dDDB916eE16e6dA23630A39F224A; //
My official Wallet address :P
// bytes(1-32)
bytes1 public raj_13 = 0xff;
// Arrays
uint256[] public raj_15 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
}
UTU/CGPIT/CE/SEM-7/Blockchain Technology
Enrollment No: 202103103510081 Date:23/8/2024
UTU/CGPIT/CE/SEM-7/Blockchain Technology
Enrollment No: 202103103510081 Date:23/8/2024
UTU/CGPIT/CE/SEM-7/Blockchain Technology
Enrollment No: 202103103510081 Date:23/8/2024
UTU/CGPIT/CE/SEM-7/Blockchain Technology