Skip to content

Instantly share code, notes, and snippets.

View i-am-vivek's full-sized avatar
🎯
Focusing

vivek i-am-vivek

🎯
Focusing
  • Madurai , Tamilnadu
View GitHub Profile
@i-am-vivek
i-am-vivek / BasicToken.sol
Created February 27, 2019 13:17
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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a, "Error");
}
@i-am-vivek
i-am-vivek / BasicToken.sol
Created February 27, 2019 13: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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a, "Error");
}
@i-am-vivek
i-am-vivek / BasicToken.sol
Created March 6, 2019 14:10
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.5+commit.47a71e8f.js&optimize=false&gist=
pragma solidity ^0.5.5;
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@i-am-vivek
i-am-vivek / index.html
Created August 17, 2020 07:57
jQuery UI Datepicker - Default functionality // source https://jsbin.com/nazoduv
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
@i-am-vivek
i-am-vivek / .deps...npm...@openzeppelin...contracts
Created November 30, 2023 18:42
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.20+commit.a1b79de6.js&optimize=false&runs=200&gist=
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="@openzeppelin/contracts CDN by jsDelivr - A free, fast, and reliable Open Source CDN for npm and GitHub">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@openzeppelin/contracts CDN by jsDelivr - A free, fast, and reliable Open Source CDN</title>
<style>
body {
font: 15px/1.4em Arial, "Helvetica Neue", Helvetica, sans-serif;
@i-am-vivek
i-am-vivek / contracts...Staking.sol
Created November 30, 2023 18:43
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.20+commit.a1b79de6.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available