Skip to content

Instantly share code, notes, and snippets.

@plutoegg
plutoegg / BasicToken.sol
Last active January 13, 2022 10:55
Deployed USD Tether Token
pragma solidity ^0.4.8;
import './ERC20Basic.sol';
import '../SafeMath.sol';
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
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;
0x14d06788090769F669427B6AEA1c0240d2321f34
@plutoegg
plutoegg / TetherToken.sol
Last active November 4, 2023 09:18
TetherToken.sol - Tether.to USD
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;
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);
@plutoegg
plutoegg / NEC.sol
Last active February 11, 2018 15:01
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.
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 September 24, 2018 13:22
Trustless Developer Guide - 1
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 September 24, 2018 13:15
Trustless Developer Guide - 2
const token = 'ZRX'
efx.contract.approve(token)
@plutoegg
plutoegg / efx_lock.js
Last active September 24, 2018 13:15
Trustless Developer Guide - 3
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)