-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create and test PausableToken Contract #206
Conversation
Amazing work @DavidKnott!!! Thanks a lot. I actually like the modifier and event names better here, so if you can also modify BTW, if you haven't already, please join our slack, I'd like to have a chat with you and thank you for your contributions :) |
Thanks for looking it over so quickly @maraoz! I like that idea, I'll integrate it with the |
db16fbf
to
5b5fef7
Compare
@maraoz I changed the |
@DavidKnott I think |
contracts/lifecycle/Pausable.sol
Outdated
if (stopped) { | ||
throw; | ||
} | ||
bool public transfersPaused = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool public paused = false;
?
contracts/lifecycle/Pausable.sol
Outdated
bool public transfersPaused = false; | ||
|
||
modifier canTransfer() { | ||
if (transfersPaused) throw; | ||
_; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenNotPaused
contracts/lifecycle/Pausable.sol
Outdated
throw; | ||
} | ||
|
||
modifier cannotTransfer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenPaused
contracts/lifecycle/Pausable.sol
Outdated
function emergencyStop() external onlyOwner { | ||
stopped = true; | ||
// called by the owner to pause transfers, triggers stopped state | ||
function pauseTransfers() onlyOwner canTransfer returns (bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pause
contracts/lifecycle/Pausable.sol
Outdated
function release() external onlyOwner onlyInEmergency { | ||
stopped = false; | ||
// called by the owner to allow transfers, returns to normal state | ||
function unpauseTransfers() onlyOwner cannotTransfer returns (bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unpause
671b869
to
927ef98
Compare
927ef98
to
b4b6029
Compare
@maraoz thanks for the feedback, I took all mentions of transactions out of the |
LGTM, many thanks for the contribution! |
…oken Create and test PausableToken Contract
Creates PausableToken contract that inherits from the StandardTokenContract.
Change Pauable contract to use
pause
as opposed toemergency
PausableToken has an owner who is able to:
Pause all token transfers
Unpause all token transfers
This contract was created in response to issue #194
It's fully tested in PausableToken.js and all tests are passing.