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
SELECT lab_name, COUNT(*) | |
FROM ( | |
SELECT (record ->> 'scientist_id')::BIGINT AS scientist_id | |
FROM measurements | |
WHERE | |
record @> '{"value_1":0}' AND | |
record @> '{"value_2":0}' AND | |
record @> '{"value_3":0}' | |
) m | |
JOIN scientist_labs AS s |
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
contract BadSplitter { | |
uint256 funds; | |
address sender; | |
address recipient; | |
// Deposit some funds in to the contract | |
function deposit(address other) payable { | |
funds = msg.value; | |
sender = msg.sender; | |
recipient = other; |
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
contract BadSender { | |
// Forward funds to the splitter contract | |
function forward(address other) payable { | |
// This is the address of the splitter contract | |
address splitterContract = 0xAe3aE77F5ab2490C46958D0b05f766871c17cA5e; | |
BadSplitter splitter = BadSplitter(splitterContract); | |
splitter.deposit.gas(200000).value(msg.value)(other); | |
} | |
// Purely malevolent fallback |
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 strict'; | |
const Reservation = artifacts.require('./Reservation.sol'); | |
contract('Reservation', accounts => { | |
var instance; | |
it('works', async function() { | |
instance = await Reservation.new(1564555780, 1, 2, 1600000000, 200000000); | |
var fee = await instance.amountPerGuest(); |
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
71ae7a23ad811c195c072b73ef22d10b2762a490 |
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
0x71ae7a23ad811c195c072b73ef22d10b2762a490 |
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/bash | |
echo "var input=`solc node_modules=node_modules --optimize --combined-json abi,bin,interface contracts/DomainSale.sol`" > contract.js | |
# First address is the ENS registry | |
geth attach ipc:/home/jgm/.ethereum/testnet/geth.ipc <<EOGETH | |
loadScript('contract.js'); | |
var contract = web3.eth.contract(JSON.parse(input.contracts["contracts/DomainSale.sol:DomainSale"].abi)); | |
personal.unlockAccount(eth.accounts[1], "throwaway"); | |
var partial = contract.new('0x112234455c3a32fd11230c42e7bccd4a84e02010', { from: eth.accounts[1], data: "0x" + input.contracts["contracts/DomainSale.sol:DomainSale"].bin, gas: 4700000, gasPrice: web3.toWei(105, 'gwei')}); |
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
[{ | |
caps: ["eth/62", "eth/63", "par/1", "par/2", "pip/1"], | |
id: "153d9a27ff1bd58d8bc030388d78c433f80577bf8ec06d083eaf2ea42208449fffc160b38b7523d925d89ef598d259822e040f299ecf8ac482e6c9b91fef3e5a", | |
name: "Parity/v1.8.2-beta-1b6588c-20171025/x86_64-linux-gnu/rustc1.21.0", | |
network: { | |
localAddress: "10.0.0.128:44074", | |
remoteAddress: "85.214.235.45:30303" | |
}, | |
protocols: { | |
eth: { |
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
// Copyright © 2018 Weald Technology Trading | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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.23; | |
pragma experimental ABIEncoderV2; | |
contract Test { | |
function test(string[] _words) public pure returns (string) { | |
return _words[0]; | |
} | |
} |
OlderNewer