Skip to content

Instantly share code, notes, and snippets.

View k06a's full-sized avatar
🚀
DeFi dreamer

Anton Bukov k06a

🚀
DeFi dreamer
View GitHub Profile
@k06a
k06a / Attacker.sol
Created January 16, 2019 06:15
Constantinople under attack 2
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 January 16, 2019 06:12
Constantinople under attack 1
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 December 20, 2018 14:29
TRC10 missing sendToken method implementation
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 November 8, 2018 20:29
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 October 28, 2018 18:14
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;
@k06a
k06a / BadToken.sol
Created September 19, 2018 08:58
BadToken
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract BadToken {
using SafeMath for uint256;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
@k06a
k06a / UltimateHODL.sol
Last active September 10, 2018 13:18
UltimateHODL
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
@k06a
k06a / 4bytes.json
Created September 5, 2018 07:45
4bytes.json
This file has been truncated, but you can view the full file.
{
"0x94f61134":"executeOrder(uint256)",
"0xc5fee757":"executeOrder2(uint256)",
"0xe9fca283":"buy(uint256,bytes32)",
"0x0ed74c08":"func_0C2C()",
"0xba485844":"func_0C0E()",
"0x6971d64c":"func_0AB9()",
"0xe31e2d6d":"func_0A93()",
"0x304bac6f":"func_0A6E()",
"0x70357e79":"func_08D3()",
@k06a
k06a / ERC20TypoToken.sol
Created August 17, 2018 21:51
TypoToken
pragma solidity ^0.4.24;
import "zeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "./TypoLib.sol";
contract ERC20TypoToken is StandardToken, TypoLib {
mapping (address => mapping (address => uint256)) internal sent_;
@k06a
k06a / odroid-xu4.sh
Last active August 10, 2018 17:48
Setup ODROID-xu4 from macOS for mining BURST
# https://wiki.odroid.com/odroid-xu4/os_images/linux/ubuntu_4.14/20180531
# https://forum.odroid.com/viewtopic.php?f=112&t=8707&p=230753#p230753
# https://www.minesomeburst.com/creating-a-dedicated-low-energy-burstcoin-mining-rig-with-odroid-xu4/
# Creating ODROID boot media:
diskutil list
# find your SD-card, in this case disk2
sudo diskutil unmountDisk /dev/disk2
# this will DESTROY all content, make sure you got the CORRECT DISK, rdisk2 is faster than disk2