Skip to content

Instantly share code, notes, and snippets.

@plutoegg
plutoegg / BasicToken.sol
Last active Jan 13, 2022
Deployed USD Tether Token
View BasicToken.sol
pragma solidity ^0.4.8;
import './ERC20Basic.sol';
import '../SafeMath.sol';
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
View TetherToken.sol
pragma solidity ^0.4.9;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
View kethplz
0x14d06788090769F669427B6AEA1c0240d2321f34
@plutoegg
plutoegg / TetherToken.sol
Last active Sep 5, 2022
TetherToken.sol - Tether.to USD
View TetherToken.sol
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
View Merkle proof
function validProof(bytes proof, bytes32 root, bytes32 hash) constant returns (bool) {
bytes32 el;
for (uint256 i = 32; i <= proof.length; i += 32) {
assembly {
el := mload(add(proof, i))
}
if (hash < el) {
hash = sha3(hash, el);
View NEC.sol
pragma solidity ^0.4.18;
/*
Copyright 2016, Jordi Baylina
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
View NectarController.sol
pragma solidity ^0.4.18;
/*
Copyright 2016, Jordi Baylina
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@plutoegg
plutoegg / efx_init.js
Last active Sep 24, 2018
Trustless Developer Guide - 1
View efx_init.js
const EFX = require('efx-api-node')
const web3 = new EFX.Web3(/*your web3 provider*/)
const efx = await EFX( web3 )
const exchangeConf = await efx.getConfig()
@plutoegg
plutoegg / efx_approve.js
Last active Sep 24, 2018
Trustless Developer Guide - 2
View efx_approve.js
const token = 'ZRX'
efx.contract.approve(token)
@plutoegg
plutoegg / efx_lock.js
Last active Sep 24, 2018
Trustless Developer Guide - 3
View efx_lock.js
const token = 'ZRX'
const amount = 15 // Number of tokens to lock
const forTime = 48 // Time after which unlocking does not require permission
const response = await efx.contract.lock(token, amount, forTime)