This file contains hidden or 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; | |
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; | |
import 'openzeppelin-solidity/contracts/token/ERC20/ERC20.sol'; | |
import './IndexedAddressArray.sol'; | |
contract Work is Ownable { | |
using IndexedAddressArray for IndexedAddressArray.Data; | |
address public jobManager; |
This file contains hidden or 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
docker run --rm -it -d --name ganache-cli -p 8145:8545 trufflesuite/ganache-cli:latest -e 10000000000 -l 4700038 -h 0.0.0.0; \ | |
truffle compile --network=test && truffle test --network=test $1; \ | |
EXIT_STATUS=$?; \ | |
echo 'Shutting down ganache-cli...'; \ | |
docker stop ganache-cli && echo 'Shut down ganache-cli' & \ | |
exit $EXIT_STATUS |
This file contains hidden or 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 | |
mkdir -p .ganache | |
ganache-cli \ | |
--db .ganache \ | |
-l 4700038 \ | |
-i 1234 \ | |
-e 100000000000 \ | |
-a 10 \ | |
-u 0 \ | |
-m "rose dynamic miracle summer near tell genius label video check stumble miss" |
This file contains hidden or 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.4; | |
/* | |
This contract is vulnerable to an attacker exploting | |
integer underflow. When you subtract from unsigned integers | |
at their lowest value (0), they cycle to their highest value. | |
Similarly, adding 1 to a max value unsigned integer will | |
cycle it to zero. | |
*/ |
This file contains hidden or 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.8; | |
import "./HoneyPot.sol"; | |
contract HoneyPotCollect { | |
HoneyPot public honeypot; | |
function HoneyPotCollect (address _honeypot) { | |
honeypot = HoneyPot(_honeypot); | |
} | |
function kill () { | |
suicide(msg.sender); | |
} |
This file contains hidden or 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.8; | |
contract HoneyPot { | |
mapping (address => uint) public balances; | |
function HoneyPot() payable { | |
put(); | |
} | |
function put() payable { | |
balances[msg.sender] = msg.value; | |
} | |
function get() { |
This file contains hidden or 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 { ipfsStorage } from 'medcredits' | |
async function getCaseDetails (ipfsHash, encryptionKey) { | |
const detailsJson = await ipfsStorage.downloadJson(ipfsHash, encryptionKey) | |
const details = JSON.parse(detailsJson) | |
const [firstImageDataUrl, secondImageDataUrl] = await Promise.all([ | |
ipfsStorage.downloadImage(details.firstImageHash, props.caseKey), | |
ipfsStorage.downloadImage(details.secondImageHash, props.caseKey) | |
]) | |
return { |
This file contains hidden or 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 ChallengeManager is Ownable, Initializable { | |
using RegistryLookup for Registry; | |
Registry registry; | |
event ChallengeDoctorSet(address indexed _case, address indexed _patient, address indexed _challengingDoctor, bytes doctorEncryptedKey); | |
event ChallengingDoctorCleared(address indexed _case, address indexed _patient, address indexed _diagnosingDoctor); | |
event CaseChallenged(address indexed _case, address indexed _patient, address indexed _challengingDoctor); | |
event ChallengedCaseClosed(address indexed _case, address indexed _patient, address indexed _diagnosingDoctor, address _challengingDoctor); |
This file contains hidden or 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 'medcredits-solidity/DoctorRegistry.sol'; | |
contract CaseFactory { | |
uint8 constant DERMATOLOGY_CODE = 0x00001a83; | |
Case[] cases; | |
mapping (uint256 => address) public caseIndices; | |
DoctorRegistry doctorRegistry; | |
function CaseFactory(DoctorRegistry _doctorRegistry) { |
This file contains hidden or 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
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version you desire here |