Skip to content

Instantly share code, notes, and snippets.

View shahzaintariq's full-sized avatar
👨‍🎓
Studying

Shahzain Tariq shahzaintariq

👨‍🎓
Studying
View GitHub Profile
@shahzaintariq
shahzaintariq / asg1class.sol
Created December 22, 2019 05:59
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.c082d0b4.js&optimize=false&gist=
pragma solidity ^0.5.11;
contract class{
struct bank {
string name;
uint age;
bool ispaid;
}
bank hbl;
@shahzaintariq
shahzaintariq / asg1class.sol
Created December 30, 2019 08:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.c082d0b4.js&optimize=false&gist=
pragma solidity ^0.5.11;
contract class{
struct bank {
string name;
uint age;
bool ispaid;
}
bank hbl;
@shahzaintariq
shahzaintariq / abstract.sol
Created January 12, 2020 05:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.12+commit.7709ece9.js&optimize=false&gist=
pragma solidity ^0.5.0;
interface IAbsCal{
function add(uint _a,uint _b) external returns(uint);
function sub(uint _a,uint _b) external returns(uint);
function mul(uint _a,uint _b) external returns(uint);
function div(uint _a,uint _b) external returns(uint);
}
@shahzaintariq
shahzaintariq / IERC.sol
Created February 21, 2020 19:39
ERC Interface
pragma solidity ^0.6.1;
interface ERC20TokenInterface {
function totalSupply() external view returns (uint);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint);
function balanceOf(address tokenOwner) external view returns (uint256);
function allowance(address tokenOwner, address spender) external view returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
@shahzaintariq
shahzaintariq / ERC.sol
Created February 21, 2020 20:01
ERC20 contract
pragma solidity ^0.6.1;
import {ERC20TokenInterface} from './IERC20.sol';
contract ERC20 is ERC20TokenInterface{
string internal tName;
string internal tSymbol;
uint256 internal tTotalSupply;
uint256 internal tdecimals;
pragma solidity 0.6.1;
contract votting{
struct candidate{
uint id;
string name;
uint voted;
}
address private owner;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Oswald:700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
body {
background-color: rgb(255, 255, 209);
}
header{
padding: 5%;
margin-left: 35%;
font-family: 'Oswald', sans-serif;;
font-size: large;
}
var web3 = new Web3('HTTP://127.0.0.1:8545')
var abi = [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
@shahzaintariq
shahzaintariq / 1_Storage.sol
Created July 2, 2020 21:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retreive value in a variable
*/
contract Storage {
uint256 number;