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 batch = window.web3.createBatch(); | |
const tasks = transactions.map(tx => new Promise((resolve, reject) => { | |
const txData = tx.data.transaction; | |
// txData is a raw transaction that looks like: | |
// { | |
// nonce: nonce, | |
// gasPrice: web3.toHex(web3.toWei('20', 'gwei')), | |
// gasLimit: 100000, | |
// to: address, | |
// value: 0, |
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 buy(address _reserveToken, uint256 _depositAmount, uint256 _minimumValue) public returns (uint256 value) { | |
uint8 reserveRatio = reserveRatioOf[_reserveToken]; | |
if (reserveRatio == 0 || _depositAmount == 0) // validate input | |
throw; | |
if (stage != Stage.Traded) // validate state | |
throw; | |
ReserveToken reserveToken = ReserveToken(_reserveToken); | |
uint256 reserveBalance = reserveToken.balanceOf(this); |
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 math | |
def isPalindrome(num): | |
# gets a number and checks if its Palindrome | |
x = num; | |
y = 0; | |
while (num > 0): | |
dig = num % 10; | |
y = y * 10 + dig; | |
num = num / 10; |