-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from 'react'; | ||
import Dialog from 'material-ui/Dialog'; | ||
import FlatButton from 'material-ui/FlatButton'; | ||
|
||
export default class BountyInstruction extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
open: false | ||
}; | ||
} | ||
|
||
handleOpen(){ | ||
this.setState({open: true}); | ||
} | ||
|
||
handleClose(){ | ||
this.setState({open: false}); | ||
} | ||
|
||
render() { | ||
const actions = [ | ||
<FlatButton | ||
label="Ok" | ||
primary={true} | ||
onTouchTap={this.handleClose.bind(this)} | ||
/> | ||
]; | ||
|
||
return( | ||
<span> | ||
<FlatButton style={{color:'white'}} label="Bounty" onClick={ () => {this.handleOpen()}} /> | ||
<Dialog | ||
title="Bounty program" | ||
actions={actions} | ||
open={this.state.open} | ||
onRequestClose={this.handleClose.bind(this)} | ||
modal={false} | ||
autoScrollBodyContent={true} | ||
contentStyle={{width:'90%', maxWidth:'none'}} | ||
> | ||
<div> | ||
<p>Please help our site secure by participating our automatic bug bounty program.</p> | ||
<ul> | ||
<li> | ||
DemoBounty Address: | ||
<a | ||
target='_blank' | ||
href={ `https://testnet.etherscan.io/address/${this.props.demoBounty.address}` }> | ||
{this.props.demoBounty.address} | ||
</a> | ||
</li> | ||
<li> | ||
Bounty Address: | ||
<a | ||
target='_blank' | ||
href={ `https://testnet.etherscan.io/address/${this.props.bounty.address}` }> | ||
{this.props.bounty.address} | ||
</a> | ||
</li> | ||
</ul> | ||
<p> | ||
Read "Fault tolerance and Automatic bug bounties" section of | ||
<a target="_blank" href="https://medium.com/bitcorps-blog/onward-with-ethereum-smart-contract-security-97a827e47702#.67zm0vrin"> Onward with Ethereum Smart Contract Security </a> | ||
blog post for more detail.for more detail. | ||
</p> | ||
</div> | ||
</Dialog> | ||
</span> | ||
) | ||
} | ||
} | ||
|
||
export default BountyInstruction; |
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import './Conference.sol'; | ||
import './zeppelin/PullPaymentCapable.sol'; | ||
|
||
/* | ||
* DemoBounty | ||
* This bounty will pay out if you can cause a Conference's balance | ||
* to not to be same as its totalBalance, which can be done by | ||
* dividing payout with undividable number (eg: 4/3 = 1.3333...) | ||
*/ | ||
contract DemoBounty is PullPaymentCapable, Rejector{ | ||
uint public totalBounty; | ||
bool public claimed; | ||
mapping(address => address) public researchers; | ||
event TargetCreation(address createdAddress); | ||
event Error(string message); | ||
|
||
function contribute() { | ||
totalBounty = msg.value; | ||
if (claimed) throw; | ||
} | ||
|
||
function createTarget() returns(Conference) { | ||
Conference target = new Conference(); | ||
researchers[target] = msg.sender; | ||
TargetCreation(target); | ||
return target; | ||
} | ||
|
||
modifier hasResearcher(Conference target) { | ||
address researcher = researchers[target]; | ||
if (researcher != 0){ | ||
_ | ||
}else{ | ||
Error('there are no researcher'); | ||
} | ||
} | ||
|
||
modifier hasBug(Conference target) { | ||
if (target.totalBalance() != target.balance){ | ||
_ | ||
}else{ | ||
Error('No security breach'); | ||
} | ||
} | ||
|
||
function claim(Conference target) hasResearcher(target) hasBug(target){ | ||
address researcher = researchers[target]; | ||
asyncSend(researcher, this.balance); | ||
totalBounty = 0; | ||
claimed = true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = function(deployer) { | ||
deployer.deploy(Conference); | ||
deployer.deploy(Bounty); | ||
deployer.deploy(DemoBounty); | ||
deployer.autolink(); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## v0.4 | ||
|
||
- Add Bounty program | ||
- Support metamask | ||
|
||
## v0.3 | ||
|
||
|