Skip to content

Instantly share code, notes, and snippets.

{
0.0.1
}
db.createView('uncles', 'blocks', [
{ $sort: { _id: -1 } },
{ $unwind: { path: '$uncles', includeArrayIndex: "index" } },
{ $project: { hash: 1, number: 1, timestamp: '$header.timestamp', index: 1, uncle: '$uncles'} },
{
$addFields: {
'uncle.timestamp': '$timestamp',
'uncle.index': '$index',
}
},
db.createView('uncles', 'blocks', [
{ $sort: { _id: -1 } },
{ $unwind: { path: '$uncles', includeArrayIndex: "position" } },
{ $project: { hash: 1, number: 1, timestamp: '$header.timestamp', index: 1, uncle: '$uncles'} },
{
$addFields: {
'uncle.timestamp': '$timestamp',
'uncle.index': '$index',
}
},
db.createView('uncles', 'blocks', [
{ $sort: { _id: -1 } },
{ $unwind: { path: '$uncles', includeArrayIndex: "position" } },
{ $project: { hash: 1, number: 1, timestamp: '$header.timestamp', index: 1, uncle: '$uncles' ,blockNumber:1} },
{
$addFields: {
'uncle.timestamp': '$timestamp',
'uncle.index': '$index',
'uncle.blockNumber': '$index',
'uncle.position':'$position'
````
git clone https://github.com/enKryptIO/ethvm
cd ethvm
# to start instead of docker-compose use
./bin/up-simple.sh
# this script will start the containers which are needed
@nnn-gif
nnn-gif / multisig.sol
Last active June 28, 2018 20:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.24;
contract Multisig {
event ReceivedContribution(address indexed _contributor, uint _valueInWei);
event ProposalSubmitted(address indexed _beneficiary, uint _valueInWei);
event ProposalApproved(address indexed _approver, address indexed _beneficiary, uint _valueInWei);
event ProposalRejected(address indexed _approver, address indexed _beneficiary, uint _valueInWei);
event WithdrawPerformed(address indexed _beneficiary, uint _valueInWei);
event ContributionPeriodIsrunning();
event SubmitContribution();
@nnn-gif
nnn-gif / ballot.sol
Created June 28, 2018 07:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Multisig {
}
0xC7Fc4E9D42A0A7249528efc307563556c6f43F5f
pragma solidity ^0.4.11;
contract SimpleAuction {
// Parameters of the auction. Times are either
// absolute unix timestamps (seconds since 1970-01-01)
// or time periods in seconds.
address public beneficiary;
uint public auctionStart;
uint public biddingTime;
0xfD861770B6B4Bc83d75B9a0Bf7aa75807F734dF8