* fix: clean up solium linting errors * fix: make various contracts natspec compliant * fix: this.balance deprecated; convert to address(this).balance * fix: contract.call deprecated and switch to gasleft() * fix: ignore empty block rule project-wide * fix: add ignore cases for the rest of the linting warnings
35 lines
930 B
Solidity
35 lines
930 B
Solidity
pragma solidity ^0.4.21;
|
|
|
|
import "../token/ERC20/BasicToken.sol";
|
|
|
|
|
|
contract ERC223ContractInterface {
|
|
function tokenFallback(address _from, uint256 _value, bytes _data) external;
|
|
}
|
|
|
|
|
|
contract ERC223TokenMock is BasicToken {
|
|
|
|
function ERC223TokenMock(address initialAccount, uint256 initialBalance) public {
|
|
balances[initialAccount] = initialBalance;
|
|
totalSupply_ = initialBalance;
|
|
}
|
|
|
|
// ERC223 compatible transfer function (except the name)
|
|
function transferERC223(address _to, uint256 _value, bytes _data) public
|
|
returns (bool success)
|
|
{
|
|
transfer(_to, _value);
|
|
bool isContract = false;
|
|
// solium-disable-next-line security/no-inline-assembly
|
|
assembly {
|
|
isContract := not(iszero(extcodesize(_to)))
|
|
}
|
|
if (isContract) {
|
|
ERC223ContractInterface receiver = ERC223ContractInterface(_to);
|
|
receiver.tokenFallback(msg.sender, _value, _data);
|
|
}
|
|
return true;
|
|
}
|
|
}
|