Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
  • Hal Finney Co.,Ltd.
  • mempool
  • X @korrio
View GitHub Profile
@korrio
korrio / CryptoHerosGame.sol
Created September 12, 2021 03:25
CryptoHerosGame.sol
pragma solidity ^0.4.17;
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
import './CryptoHerosToken.sol';
contract CryptoHerosGame is Ownable {
uint constant gameFee = 0.005 ether;
uint constant minPrice = 0.01 ether;
uint constant minHerosToken = 5 ether;
@korrio
korrio / CryptoHerosToken.sol
Created September 12, 2021 03:24
CryptoHerosToken.sol
pragma solidity ^0.4.17;
import 'zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol';
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
/**
* @title ERC721TokenMock
* This mock just provides a public mint and burn functions for testing purposes,
* and a public setter for metadata URI
*/
@korrio
korrio / MasterChefWithVonderToken.sol
Created September 10, 2021 06:46
MasterChefWithVonderToken.sol
// File: contracts/VonderToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
@korrio
korrio / IERC20.sol
Created September 5, 2021 07:31
IERC20.sol
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
@korrio
korrio / truffle-config.js
Created September 4, 2021 06:10
truffle-config.js
const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');
const fs = require('fs');
const { infuraProjectId, mainnetBkcPrivateKeys, testnetBkcPrivateKeys, mainnetPrivateKeys, privateKeys, etherApiKey, bscApiKey } = JSON.parse(fs.readFileSync('.secret').toString().trim());
const binanceProvider = new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: `https://data-seed-prebsc-2-s1.binance.org:8545`
});
@korrio
korrio / NICK.sol
Created August 29, 2021 08:33
NICK.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/ERC20Pausable.sol";
contract NickToken is ERC20, Pausable {
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
@korrio
korrio / NICK.sol
Created August 29, 2021 08:01
NICK.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
@korrio
korrio / PostFlashloan.sol
Created August 29, 2021 07:08
PostFlashloan.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
@korrio
korrio / Arbitrage.sol
Created August 29, 2021 06:46
Arbitrage.sol
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
@korrio
korrio / Flashloan_swap.sol
Created August 29, 2021 05:42
Flashloan_swap.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/