421 def estimate_gas(self, transaction):
1 # TODO: move this to the VM level (and use binary search approach)
2 signed_evm_transaction = self._get_normalized_and_signed_evm_transaction(
3 dict(transaction, gas=self._max_available_gas()),
4 )
5
6 computation = _execute_and_revert_transaction(self.chain, signed_evm_transaction, 'pending')
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
#!/bin/sh | |
# This script wants to synchronize multiple public Git repositories with each | |
# other | |
# | |
# Use it (e.g. in a Jenkins job) like this: | |
# | |
# $0 <Git-URL>... | |
# | |
# where Git-URL is either a push URL, or a pair of a fetch and a push URL |
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
import contextlib | |
import json | |
import os | |
import pprint | |
import shutil | |
import signal | |
import socket | |
import subprocess | |
import sys | |
import time |
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
1. first-come-first-serve issue claiming (how it is now) | |
pros: | |
- Most accepting to new contributors | |
- Helps grow # of contributors | |
- Has a feeling of fairness | |
- Is built-in to gitcoin; no added guidelines need to be enforced. | |
cons: | |
- Code quality varies (increases review effort) |
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
import time | |
import web3 | |
from solc import compile_source | |
from web3 import Web3, EthereumTesterProvider | |
contract_source = ''' | |
pragma solidity ^0.4.18; |
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
$ make release-desktop | |
git clean -qdxf -f ./index.desktop.js desktop/ | |
scripts/run-pre-build-check.sh desktop | |
Finished! | |
lein prod-build-desktop | |
Updating hook: pre-commit | |
Updating hook: pre-commit | |
Updating hook: pre-commit | |
Compiling ClojureScript... | |
Compiling ["index.desktop.js"] from ["components/src" "react-native/src/cljsjs" "react-native/src/desktop" "src" "env/prod"]... |
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
from web3 import HTTPProvider, Web3 | |
erc20_abi = json.loads('[{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"d |
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
use std::rc::Rc; | |
#[derive(Debug)] | |
pub struct List<T> { | |
head: Link<T>, | |
} | |
type Link<T> = Option<Rc<Node<T>>>; | |
// Option because sometimes there is no Node. | |
// Nodes need to be wrapped in an RC because we need to |