Skip to content

Commit

Permalink
Merge pull request trusttoken#53 from wjmelements/paused-helper
Browse files Browse the repository at this point in the history
Paused Helper
  • Loading branch information
terryli0095 authored Jan 17, 2019
2 parents 4ab9274 + a888163 commit 1491d81
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions contracts/TrueUSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ GasRefundToken {
token.transfer(_to, balance);
}

function paused() public pure returns (bool) {
return false;
}

/**
*@dev allows owner of TrueUSD to gain ownership of any contract that TrueUSD currently owns
*/
Expand Down
3 changes: 3 additions & 0 deletions contracts/utilities/PausedTrueUSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ contract PausedToken is HasOwner {
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
revert("Token Paused");
}
function paused() public pure returns (bool) {
return true;
}
}

/** @title PausedDelegateERC20
Expand Down
4 changes: 3 additions & 1 deletion test/PausedTrueUSD.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ contract('PausedTrueUSD', function (accounts) {
})

it('current token is not paused', async function(){
assert.equal(await this.token.paused(), false);
await this.token.transfer(otherAddress, 10*10**18, { from: oneHundred })
})

it('current token is not paused', async function(){
it ('unpaused token can burn', async function() {
await this.token.burn(10000*10**18, { from: oneHundred })
})

Expand All @@ -77,6 +78,7 @@ contract('PausedTrueUSD', function (accounts) {

describe('token transfers are now paused', function(){
it ('transfer is now paused', async function(){
assert.equal(await this.token.paused(), true);
await assertRevert(this.token.transfer(otherAddress, 10*10**18, { from: oneHundred }))
await assertRevert(this.original.transfer(otherAddress, 10*10**18, { from: oneHundred }))
})
Expand Down

0 comments on commit 1491d81

Please sign in to comment.