diff --git a/contracts/ownership/HasNoEther.sol b/contracts/ownership/HasNoEther.sol index 8808e2fc3..c24ee07b0 100644 --- a/contracts/ownership/HasNoEther.sol +++ b/contracts/ownership/HasNoEther.sol @@ -36,7 +36,6 @@ contract HasNoEther is Ownable { * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { - // solium-disable-next-line security/no-send - assert(owner.send(address(this).balance)); + owner.transfer(this.balance); } } diff --git a/contracts/token/ERC20/SafeERC20.sol b/contracts/token/ERC20/SafeERC20.sol index 075e88a13..b5042e264 100644 --- a/contracts/token/ERC20/SafeERC20.sol +++ b/contracts/token/ERC20/SafeERC20.sol @@ -12,7 +12,7 @@ import "./ERC20.sol"; */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { - assert(token.transfer(to, value)); + require(token.transfer(to, value)); } function safeTransferFrom( @@ -23,10 +23,10 @@ library SafeERC20 { ) internal { - assert(token.transferFrom(from, to, value)); + require(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { - assert(token.approve(spender, value)); + require(token.approve(spender, value)); } } diff --git a/test/token/ERC20/SafeERC20.test.js b/test/token/ERC20/SafeERC20.test.js index 1b663a5a6..03ec3fee8 100644 --- a/test/token/ERC20/SafeERC20.test.js +++ b/test/token/ERC20/SafeERC20.test.js @@ -1,4 +1,4 @@ -import EVMThrow from '../../helpers/EVMThrow'; +import EVMRevert from '../../helpers/EVMRevert'; require('chai') .use(require('chai-as-promised')) @@ -12,15 +12,15 @@ contract('SafeERC20', function () { }); it('should throw on failed transfer', async function () { - await this.helper.doFailingTransfer().should.be.rejectedWith(EVMThrow); + await this.helper.doFailingTransfer().should.be.rejectedWith(EVMRevert); }); it('should throw on failed transferFrom', async function () { - await this.helper.doFailingTransferFrom().should.be.rejectedWith(EVMThrow); + await this.helper.doFailingTransferFrom().should.be.rejectedWith(EVMRevert); }); it('should throw on failed approve', async function () { - await this.helper.doFailingApprove().should.be.rejectedWith(EVMThrow); + await this.helper.doFailingApprove().should.be.rejectedWith(EVMRevert); }); it('should not throw on succeeding transfer', async function () {