This file contains 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
library itmap { | |
struct entry { | |
// Equal to the index of the key of this item in keys, plus 1. | |
uint keyIndex; | |
uint value; | |
} | |
struct itmap { | |
mapping(uint => entry) data; | |
uint[] keys; |
This file contains 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
/* | |
In Ethereum, a contract can be written so that it returns a value for eth_call. | |
A Dapp can then check for success or error value of eth_call, before calling eth_sendTransaction, | |
to take advantage of eth_call effectively being a "preview" of the code flow that the transaction | |
will take. In traditional client-server, clients can't ask servers beforehand what's going to | |
happen when the client makes a call; with Dapps contracts can be written so that clients can ask | |
for a "preview" of what is going to happen, before any funds/ethers are actually utilized | |
(eth_call does not cost any ethers). | |
Note: it is possible that in between eth_call and when eth_sendTransaction is actually mined, |
This file contains 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
pyepm -a 29d33c02a200937995e632c4597b4dca8e503978 testBulkDeploy.yaml | |
PyEPM 0.9.6 | |
===== | |
Deploying testBulkDeploy.yaml... | |
Loading testBulkDeploy.yaml... | |
Parsing testBulkDeploy.yaml... | |
deploy: | |
Deploying btcBulkStoreHeaders.py... | |
Contract will be available at 0xb8e116ddf8b8d451e04c5733a96a853b9036e883 | |
Waiting for transaction... took 3s |
This file contains 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
pyepm -a 29d33c02a200937995e632c4597b4dca8e503978 testBulkDeploy.yaml | |
PyEPM 0.9.5-2-g13e13e7-dirty | |
===== | |
Deploying testBulkDeploy.yaml... | |
Loading testBulkDeploy.yaml... | |
Parsing testBulkDeploy.yaml... | |
deploy: | |
Deploying btcBulkStoreHeaders.py... | |
Contract will be available at 0xcf2d91e4a42568344d6222f08003db3104f3cddd | |
Waiting for transaction.. took 2s |
This file contains 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
pyepm -a f52a423ecad0b6c70b5adf69edbe51b9db11c7c9 testBulkDeploy.yaml | |
PyEPM 0.9.6 | |
===== | |
Deploying testBulkDeploy.yaml... | |
Loading testBulkDeploy.yaml... | |
Parsing testBulkDeploy.yaml... | |
deploy: | |
Deploying btcBulkStoreHeaders.py... | |
Contract will be available at 0x6da764a088e1d16610f38b305eb4f320f1cb227c | |
Waiting for transaction. |
This file contains 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
pyepm -a 9409fe90e19bc99a9316e9f80bb3ede98cffac75 testBulkDeploy.yaml | |
PyEPM 0.9.6-2-ga67094c | |
===== | |
Deploying testBulkDeploy.yaml... | |
Loading testBulkDeploy.yaml... | |
Parsing testBulkDeploy.yaml... | |
deploy: | |
Deploying btcBulkStoreHeaders.py... | |
Contract will be available at 0xdc6b46483528c59c7354f3f84e27e79f41ad1e55 | |
Waiting for transaction............................................. took 45s |
This file contains 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
# Found from https://snipt.net/akaihola/move-untracked-files-outside-a-git-repository/ | |
git ls-files --others --exclude-standard -z | cpio -pmd0 ../untracked/ | |
# git clean -d -f | |
# git ls-files: print a | |
# * null-delimited (-z) list of | |
# * untracked (--others) | |
# * non-ignored (--exclude-standard) files. | |
# cpio: |
This file contains 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
byte = range(32) | |
def flipBytes(n): | |
numByte = 32 | |
mask = 0xff | |
i = 0 | |
while i < numByte: | |
b = n & mask | |
b /= 2 ** (i*8) | |
b *= 2 ** ((numByte-i-1)*8) |
This file contains 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
data byte[32] | |
def flipBytes(n): | |
numByte = 5 | |
mask = 0xff | |
i = 0 | |
while i < numByte: | |
b = n & mask | |
b /= 2^(i*8) | |
b *= 2^((numByte-i-1)*8) |
This file contains 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
storageTrie.get(key, function(err, found) { | |
if (found || (!found && val.toString('hex') === '00')) { | |
gasLeft = gasLeft.add(100); | |
} else if (!found && val.toString('hex') !== '00') { | |
gasLeft = gasLeft.sub(100); | |
} else if (found && val.toString('hex') === '00') { | |
gasLeft = gasLeft.add(200); | |
} | |
if (val.toString('hex') === '00') { |
NewerOlder