This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const token = 'ZRX' | |
| efx.contract.approve(token) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const EFX = require('efx-api-node') | |
| const web3 = new EFX.Web3(/*your web3 provider*/) | |
| const efx = await EFX( web3 ) | |
| const exchangeConf = await efx.getConfig() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x14d06788090769F669427B6AEA1c0240d2321f34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.8; | |
| import './ERC20Basic.sol'; | |
| import '../SafeMath.sol'; | |
| /** | |
| * @title Basic token | |
| * @dev Basic version of StandardToken, with no allowances. |
NewerOlder