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 server folder | |
:server kirill$ ~/google-cloud-sdk/bin/gcloud app deploy --appyaml yaml/app.yaml | |
Services to deploy: | |
descriptor: [yaml/app.yaml] | |
source: [/Users/kirill/Prog/StepApp/steplaunch-app/server] | |
target project: [step-launchpad] | |
target service: [default] | |
target version: [20220921t075001] |
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
# This snippet generates BIP-39 mnemonic (seed phrase) | |
# then derives 10 Ethereum private keys from it (with their addresses) | |
# The same algorithm and paths are used in Metamask, Trust Wallet, Ganache, hardhat | |
# and other popular wallets and tools. | |
from bip44 import Wallet | |
from bip44.utils import get_eth_addr | |
from mnemonic import Mnemonic | |
mnemo = Mnemonic("english") | |
words = mnemo.generate() |
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
ethereum.enable(); | |
var governanceContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"allProposalsFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_targetContract","type":"address"},{"name":"_transaction","type":"bytes"}],"name":"newProposal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"proposals","outputs":[{"name":"finished","type":"bool"},{"name":"yesVotes","type":"uint256"},{"name":"noVotes","type":"uint256"},{"name":"targetContract","type":"address"},{"name":"transaction","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"voters","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"allProposals","outputs":[{"name":"","type":"b |
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
pragma solidity ^0.5.0; | |
contract MyToken { | |
string public name = "Very Bad Token"; | |
string public symbol = "VBT"; | |
uint8 public decimals = 2; | |
mapping (address => uint256) public balances; | |
uint256 public totalSupply; | |
event Transfer(address indexed from, address indexed to, uint256 value); |
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
pragma solidity ^0.5.2; | |
/** | |
* @title SafeMath | |
* @dev Unsigned math operations with safety checks that revert on error | |
*/ | |
library SafeMath { | |
/** | |
* @dev Multiplies two unsigned integers, reverts on overflow. | |
*/ |
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
pragma solidity ^0.4.24; | |
// File: contracts/ERC223ReceivingContract.sol | |
/** | |
* @title Contract that will work with ERC223 tokens. | |
*/ | |
contract ERC223ReceivingContract { | |
/** |
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
pragma solidity ^0.4.13; | |
contract Receiver { | |
function tokenFallback(address from, uint value, bytes data); | |
} | |
/* | |
* ERC20 interface | |
* see https://github.com/ethereum/EIPs/issues/20 | |
* |
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 sha3 import keccak_256 | |
from eth_keys import keys | |
def privkey_from_parity_phrase(phrase): | |
h = keccak_256(phrase.encode('utf-8')) | |
for i in range(16384): | |
h = keccak_256(h.digest()) | |
while keys.PrivateKey(h.digest()).public_key.to_checksum_address()[0:4] != '0x00': | |
h = keccak_256(h.digest()) | |
private_key = h | |
return private_key |
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
/* | |
Example of web3 call via injected web3 at browser's console | |
*/ | |
web3.eth.getBlock(100, function(error, result){ | |
if(!error) | |
console.log(result); | |
else | |
console.error(error); | |
}); |
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
""" | |
pip install eth-hash | |
pip install eth-keys | |
""" | |
from eth_keys import keys | |
from os import urandom | |
from eth_hash.auto import keccak | |
# Generate | |
private_key = keccak(urandom(4096)) | |
private_key_bytes = private_key |
NewerOlder