Skip to content

Instantly share code, notes, and snippets.

View ArslanKathia's full-sized avatar
🌏
Working from home

Arslan Maqbool ArslanKathia

🌏
Working from home
View GitHub Profile
@ArslanKathia
ArslanKathia / contracts...Kat721.sol
Created February 22, 2023 16:12
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
@ArslanKathia
ArslanKathia / contracts...KatCoin20.sol
Created February 22, 2023 11:49
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
//import "@openzeppelin/contracts/token/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
@ArslanKathia
ArslanKathia / contracts...crud.sol
Created February 16, 2023 15:58
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
contract CollegeData{
struct Student{
uint rollNo;
string name;
string class;
@ArslanKathia
ArslanKathia / contracts...EtherGame.sol
Created February 15, 2023 17:11
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.2 < 0.9.0;
contract EtherGame{
uint public targetAmount;
address public winner;
constructor(){
targetAmount = 7 ether;
@ArslanKathia
ArslanKathia / contracts...CrowdFunder.sol
Created February 14, 2023 18:44
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.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 < 0.9.0;
contract CrowdFunder{
//variables set by the creator
address public creator;
address payable public fundRecipient;
uint public minimumToRaise;
string campignUrl;
@ArslanKathia
ArslanKathia / contracts-live...freelancer.sol
Created February 8, 2023 18:34
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 < 0.9.0;
contract Freelancer{
address public owner;
uint256 private coins;
uint256 private cash;
bytes32 private service;
@ArslanKathia
ArslanKathia / contracts-live...simplebank-contract.sol
Created February 7, 2023 18: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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 < 0.9.0;
contract SimpleBank{
mapping(address => uint) private balances;
address public owner;
@ArslanKathia
ArslanKathia / basics.sol
Created February 7, 2023 17:33
Basics of Solidity
// Now, the basics of Solidity
// 1. DATA TYPES AND ASSOCIATED METHODS
// uint used for currency amount (there are no doubles
// or floats) and for dates (in unix time)
uint x;
// int of 256 bits, cannot be changed after instantiation
int constant a = 8;
int256 constant a = 8; // same effect as line above, here the 256 is explicit
@ArslanKathia
ArslanKathia / contracts-live...voting-contract.sol
Created February 7, 2023 16:58
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.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: GPL-3.0
pragma solidity >= 0.7.0 < 0.8.18;
contract Ballot{
struct Voter{
uint weight;
bool voted;
address delegate;
@ArslanKathia
ArslanKathia / contracts-live...ownable-contract.sol
Created February 6, 2023 17:38
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract Ownable{
address public owner;
event OwnershipTransferred(address indexed _previousOwner, address indexed newOnwer);
modifier onlyOwner{
require(owner == msg.sender,"Only Owner can access this");