I hereby claim:
- I am mpolci on github.
- I am mpolci (https://keybase.io/mpolci) on keybase.
- I have a public key whose fingerprint is C644 E36B BF11 AA8C B4CF AA3A EBDF B31D 105A DE10
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/* A contract to store goods with escrowed funds. */ | |
/* Deployment: | |
Owner: seller | |
Last address: dynamic | |
ABI: [{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"escrows","outputs":[{"name":"buyer","type":"address"},{"name":"lockedFunds","type":"uint256"},{"name":"frozenTime","type":"uint256"},{"name":"frozenFunds","type":"uint256"},{"name":"buyerNo","type":"uint256"},{"name":"sellerNo","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint16"}],"type":"function"},{"constant":false,"inputs":[{"name":"datainfo","type":"string"},{"name":"_version","type":"uint256"}],"name":"cancel","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"seller","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"freezePeriod","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"datainfo","type":"string"},{"name":"_version" |
function rpc(method, arg) { | |
var req = { | |
jsonrpc: "2.0", | |
method: method, | |
id: new Date().getTime() | |
}; | |
if (arg) req.params = arg; | |
return new Promise((resolve, reject) => { | |
web3.currentProvider.sendAsync(req, (err, result) => { |
Truffle since release 2.0.8 delays the initialization of the global variable web3
after the load event, so this variable
is not available during angular bootstrap, inside a .config() section, inside providers and neither inside the controllers
initialized at load time and related injected services.
Accessing to the web3 variable inside a setTimeout() call could be a solution for simple projects but the only way to be sure that web3 is initialized is to postpone the angular bootstrap.
Looks at the code below:
This function create a saga that runs the sagas in the startingSagas
array and takes
the actions with type indicated by changeActionType
to replace the running sagas.
The replacing actions must have a field sagas
cointaining the array with the new sagas.
function createDynamicSaga (changeActionType, startingSagas) {
function* _start (sagas) {
try {
yield sagas
'use strict'; | |
angular.module('copayAddon.twinWallet').directive('twMnemonicAdvice', function () { | |
return { | |
restrict: 'AE', | |
transclude: true, | |
scope: { | |
prefix: '=', | |
language: '=', | |
words: '=' |
function evmSnapshot() { | |
const res = web3.currentProvider.send({ | |
jsonrpc: '2.0', | |
method: 'evm_snapshot', | |
params: [], | |
id: Date.now() | |
}) | |
// if (res.error) ... not required in sync call | |
return res.result | |
} |
pragma solidity ^0.5.13; | |
contract TestChainID { | |
function getChainID() external pure returns (uint256) { | |
uint256 id; | |
assembly { | |
id := chainid() | |
} | |
return id; | |
} |
diff --git a/web3deployment/reserveDeployer.js b/web3deployment/reserveDeployer.js | |
index 064eee8..a4d66ca 100755 | |
--- a/web3deployment/reserveDeployer.js | |
+++ b/web3deployment/reserveDeployer.js | |
@@ -158,6 +158,7 @@ const input = { | |
), | |
'Utils.sol': fs.readFileSync(contractPath + 'Utils.sol', 'utf8'), | |
'Utils2.sol': fs.readFileSync(contractPath + 'Utils2.sol', 'utf8'), | |
+ 'Utils3.sol': fs.readFileSync(contractPath + 'Utils3.sol', 'utf8'), | |
'FeeBurnerInterface.sol': fs.readFileSync( |
// based entirely on this blog post: | |
// http://druss.co/2016/04/export-all-workouts-from-sports-tracker/ | |
// unfortunately the original script no longer works, moslty because jQuery is | |
// no longer available on sports-tracker pages. | |
// | |
// I've compiled the changes proposed in the comments in the script below. | |
// to use the script, login to your sports-tracker account | |
// change URL to http://www.sports-tracker.com/diary/workout-list | |
// open browser console (Cmd-Shift-I) |