Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
4bfc2ba8
Commit
4bfc2ba8
authored
Aug 11, 2016
by
Manuel Araoz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stoppable and stoppablebid example
parent
f719bbf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
Stoppable.sol
contracts/Stoppable.sol
+25
-0
StoppableBid.sol
contracts/StoppableBid.sol
+26
-0
2_deploy_contracts.js
migrations/2_deploy_contracts.js
+0
-2
No files found.
contracts/Stoppable.sol
0 → 100644
View file @
4bfc2ba8
/*
* Stoppable
*/
contract Stoppable {
address public curator;
bool public stopped;
modifier stopInEmergency { if (!stopped) _ }
modifier onlyInEmergency { if (stopped) _ }
function Stoppable(address _curator) {
if (_curator == 0) {
throw;
}
curator = _curator;
}
function emergencyStop() external {
if (msg.sender != curator) {
throw;
}
stopped = true;
}
}
contracts/StoppableBid.sol
0 → 100644
View file @
4bfc2ba8
import './PullPaymentCapable.sol';
import './Stoppable.sol';
contract StoppableBid is Stoppable, PullPaymentCapable {
address public highestBidder;
uint public highestBid;
function StoppableBid(address _curator)
Stoppable(_curator)
PullPaymentCapable() {}
function bid() external stopInEmergency {
if (msg.value <= highestBid) throw;
if (highestBidder != 0) {
asyncSend(highestBidder, highestBid);
}
highestBidder = msg.sender;
highestBid = msg.value;
}
function withdraw() onlyInEmergency {
suicide(curator);
}
}
migrations/2_deploy_contracts.js
View file @
4bfc2ba8
module
.
exports
=
function
(
deployer
)
{
deployer
.
deploy
(
BadFailEarly
);
deployer
.
deploy
(
GoodFailEarly
);
deployer
.
deploy
(
PullPaymentBid
);
deployer
.
deploy
(
BadArrayUse
);
deployer
.
deploy
(
Bounty
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment