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
| //to accompany ethers_structs.js | |
| pragma solidity 0.4.21; | |
| pragma experimental ABIEncoderV2; | |
| contract TestContract { | |
| struct SubStruct { | |
| uint256 id; | |
| string description; | |
| } |
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
| // setup ethers.js, sends an instance of a struct to an external function, and returns it the instance values. | |
| //load in node: .load ~/path/to/file/ethers_setup.js | |
| //first run testrpc locally. | |
| var privkey = "0x{privkey}" //insert privkey from testrpc here | |
| //dependancies | |
| var solc = require('solc') //include solc application | |
| var fs = require('fs') //include node file manipulation module |
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
| from time import time | |
| import hashlib | |
| import hmac | |
| import requests | |
| key = "API_KEY" | |
| secret = "SECRET_KEY" | |
| nonce = str(int(time() * 1000)) | |
| #sign and call the url. |
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
| // Wrapper for built-in BigNumber_modexp (contract 0x5) as described here. https://github.com/ethereum/EIPs/pull/198 | |
| function modexp(bytes memory _base, bytes memory _exp, bytes memory _mod) internal view returns(bytes memory ret) { | |
| assembly { | |
| let bl := mload(_base) | |
| let el := mload(_exp) | |
| let ml := mload(_mod) | |
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
| import requests | |
| import json | |
| import pdb | |
| import time | |
| import sys | |
| BUY = 0 | |
| SELL = 1 |
NewerOlder