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
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 May 17, 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);
}
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);
View n2-to-n.cpp
typedef unsigned __int64 u64;
//
// i\j 0 1 2 3 4
// 0 0 2 5 9
// 1 1 4 8
// 2 3 7
// 3 6
// 4
//
@k06a
k06a / Attacker.sol
Created Jan 16, 2019
Constantinople under attack 2
View Attacker.sol
pragma solidity ^0.5.0;
contract Attacker {
address payable constant public token = 0x07d67Cb7736c9812277f6d1921fa872bff9Ea160;
uint flag;
function attack() public payable {
require(msg.value > 0);
@k06a
k06a / SimpleEtherToken.sol
Created Jan 16, 2019
Constantinople under attack 1
View SimpleEtherToken.sol
pragma solidity ^0.5.0;
contract SimpleEtherToken {
string constant public name = "SimpleEtherToken";
string constant public symbol = "SETH";
uint8 constant public decimals = 18;
mapping (address => uint256) public balanceOf;
@k06a
k06a / TRC10.sol
Last active Dec 20, 2018
TRC10 missing sendToken method implementation
View TRC10.sol
library TRC10 {
using TRC10 for address;
function sendToken(address to, uint256 tokenid, uint256 amount) internal returns(bool) {
return this.call(abi.encodeWithSelector(this._transferToken.selector, to, tokenid, amount));
}
function _transferToken(address to, uint256 tokenid, uint256 amount) private {
to.transferToken(tokenid, amount);
}
@k06a
k06a / Uints.sol
Last active Nov 8, 2018
Uints.sol
View Uints.sol
pragma solidity ^0.4.24;
library Uints {
using Uints for uint256;
using Uints for uint256[2];
using Uints for uint256[4];
using Uints for uint256[8];
using Uints for uint256[16];
@k06a
k06a / OptimizedArray.sol
Created Oct 28, 2018
OptimizedArray.sol
View OptimizedArray.sol
pragma solidity ^0.4.24;
library OptimizedArray {
struct Data {
mapping(uint256 => uint256) m;
uint256 length;
}
function length(Data storage data) internal view returns(uint256) {
return data.length;
You can’t perform that action at this time.