Skip to content

Instantly share code, notes, and snippets.

Anton Bukov k06a

Block or report user

Report or block k06a

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@k06a
k06a / AuRa.cpp
Last active Aug 15, 2019
AuRa Random
View AuRa.cpp
#include <iostream>
#include <vector>
#include <math.h>
#include <numeric>
#include <tuple>
#include <algorithm>
std::tuple<std::vector<int>,int> selectRandom1(std::vector<int> likehoods, int sum, uint m) {
@k06a
k06a / log_2_rand_0_1.sol
Last active Aug 16, 2019
log_2_rand_0_1
View log_2_rand_0_1.sol
/*
* ABDK Math 64.64 Smart Contract Library. Copyright © 2019 by ABDK Consulting.
* Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
*/
pragma solidity ^0.5.7;
/**
* Modified version of this code:
* https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L366
*
View DeepStakingPool.sol
pragma solidity ^0.5.0;
import "github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "github.com/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol";
interface IValidatorSet {
function isValidator(address candidate) external view returns(bool);
}
contract BasePool {
View StakingPool.sol
pragma solidity ^0.5.0;
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
contract StakingPool1 is ERC20 {
function () public payable {
}
function deposit() public payable {
@k06a
k06a / boolinq3
Last active Jun 28, 2019
boolinq3.cpp
View boolinq3
#include <functional>
#include <iterator>
#include <iostream>
#include <vector>
#include <list>
#include <unordered_set>
//
View gist:28c0d8a69694bd4612d3a8744c6e80aa
pragma solidity ^0.5.0;
contract ERC20 {
using SafeMath for uint256;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
View BestPrice.sol
interface IUniswap {
function getEthToTokenInputPrice(uint256 eth_sold) external view returns(uint256);
function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns(uint256);
function getTokenToEthInputPrice(uint256 tokens_sold) external view returns(uint256);
function getTokenToEthOutputPrice(uint256 eth_bought) external view returns(uint256);
}
interface IBancor {
function getReturnByPath(address[] calldata _path, uint256 _amount) external view
returns (uint256 amount, uint256 conversion_fee);
View GasRefund.sol
contract GasRefund {
uint256 private _begin;
uint256 private _end;
function refundSupply() public view returns(uint256 supply) {
return _end - _begin;
}
function burn(uint256 n) internal {
uint256 begin = _begin;
@k06a
k06a / GasDiscounter.sol
Last active Aug 18, 2019
Universal Gas Discounter
View GasDiscounter.sol
interface IUniswap {
function getEthToTokenInputPrice(uint256 eth_sold) external view returns(uint256);
function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns(uint256);
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns(uint256);
}
interface IGasToken {
function free(uint256 value) external returns (bool success);
function freeUpTo(uint256 value) public returns (uint256 freed);
function freeFromUpTo(address from, uint256 value) public returns (uint256 freed);
View Multisend.sol
pragma solidity ^0.5.7;
contract Token {
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 amount);
function transfer(address to, uint256 amount) public returns(bool) {
_transfer(msg.sender, to, amount);
You can’t perform that action at this time.