Skip to content

Instantly share code, notes, and snippets.

View atisheksingh's full-sized avatar
🏢
Working from office

atisheks1 atisheksingh

🏢
Working from office
  • Blockchain Architech @ OriginalsGateways
  • Pune , India
  • 15:11 (UTC +05:30)
View GitHub Profile
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/Math.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol";
export var RewardAddress = '0x508fe55441E0a123bF4a866Fb9e8521573D8C40B'
export var StakeAddress = '0x508fe55441E0a123bF4a866Fb9e8521573D8C40B'
export var MplRewardsAddress = '0x3967Ac313c926d45b2AC2Ee4f86855833B18068a'
export var RewardAbi =[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
@atisheksingh
atisheksingh / asvastaking.sol
Last active July 15, 2023 04:47
staking contract with all the function
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol";
/**
*Submitted for verification at polygonscan.com on 2021-12-20
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
[
{
"inputs": [
{
"internalType": "address",
"name": "_user",
"type": "address"
}
],
"stateMutability": "nonpayable",
@atisheksingh
atisheksingh / BnbStaking.sol
Created March 12, 2022 17:08 — forked from serefercelik/BnbStaking.sol
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.12+commit.27d51765.js&optimize=true&runs=200&gist=
pragma solidity 0.6.12;
import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol';
// import "@nomiclabs/buidler/console.sol";
interface IWBNB {

Compile

npx hardhat compile

Run unit tests

npx hardhat test

Start local node

npx hardhat node

Deploy to Rinkeby

@atisheksingh
atisheksingh / solidity-enums-with-data.md
Created July 15, 2022 13:31 — forked from cameel/solidity-enums-with-data.md
Enums with data in Solidity

Use cases

  • Optional/nullable data types.
  • Variant data types.
  • Flag with extra information needed only in some cases (or different in different cases).
  • Modeling states in a state machine where each state can have some data associated with it.
  • List of operations for batch processing, where each operation can have its own arguments.
  • Alternative to function overloading that allows avoiding combinatorial explosion when there are multiple parameters that need variants.
  • Nested data structures with heterogenous nodes.

Syntax and semantics