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
/** | |
*Submitted for verification at Etherscan.io on 2020-04-01 | |
*/ | |
pragma solidity ^0.5.0; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. |
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
/** | |
*Submitted for verification at Etherscan.io on 2020-04-01 | |
*/ | |
pragma solidity ^0.5.0; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. |
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
/** | |
*Submitted for verification at Etherscan.io on 2020-04-01 | |
*/ | |
pragma solidity ^0.5.0; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. |
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
//if something breaks, go to this file: https://github.com/jpmorganchase/quorum-examples/blob/master/vagrant/bootstrap.sh | |
# install build deps | |
sudo add-apt-repository ppa:ethereum/ethereum | |
sudo apt-get update | |
sudo apt install make | |
sudo apt install g++ -y | |
sudo apt-get install -y build-essential unzip libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev solc sysvbanner wrk software-properties-common default-jdk maven | |
//installing go |
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' | |
/* eslint-disable no-console */ | |
const PeerId = require('peer-id') | |
const PeerInfo = require('peer-info') | |
const Node = require('./libp2p_bundle') | |
const pull = require('pull-stream') | |
const Pushable = require('pull-pushable') | |
const p = Pushable() | |
const chalk = require('chalk'); | |
const emoji = require('node-emoji') |
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 EtherGame { | |
uint public payoutMileStone1 = 3 ether; | |
uint public mileStone1Reward = 2 ether; | |
uint public payoutMileStone2 = 5 ether; | |
uint public mileStone2Reward = 3 ether; | |
uint public finalMileStone = 10 ether; | |
uint public finalReward = 5 ether; | |
uint public depositedWei; | |
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 EtherStore { | |
uint256 public withdrawalLimit = 1 ether; | |
mapping(address => uint256) public lastWithdrawTime; | |
mapping(address => uint256) public balances; | |
function depositFunds() public payable { | |
balances[msg.sender] += msg.value; | |
} | |
function withdrawFunds (uint256 _weiToWithdraw) public { |
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.11; | |
import "./Product.sol"; | |
import "./Addition.sol"; | |
import "./ResultStorage.sol"; | |
contract Calculator is ResultStorage { | |
Product public product; | |
Addition public addition; |
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
// GetDocument handles READ operations of a DAG entry by CID, returning the corresponding document | |
func GetDocument(ref, key string) (out SampleStruct, err error) { | |
err = sh.DagGet(ref+"/"+key, &out) | |
return | |
} |
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 "EtherStore.sol"; | |
contract Attack { | |
EtherStore public etherStore; | |
// intialise the etherStore variable with the contract address | |
constructor(address _etherStoreAddress) { | |
etherStore = EtherStore(_etherStoreAddress); | |
} | |
function pwnEtherStore() public payable { | |
// attack to the nearest ether |
NewerOlder