fix: solium linting errors (#1113)

* fix: solium linting errors, fixes #1092

* fix: remove uppercase requirement
This commit is contained in:
Matt Condon
2018-07-27 10:53:24 +08:00
committed by Nicolás Venturo
parent 2f6c8b05f6
commit 4c6575bf2f
6 changed files with 18 additions and 8 deletions

View File

@ -4,6 +4,7 @@
"rules": {
"quotes": ["error", "double"],
"no-empty-blocks": "off",
"uppercase": "off",
"indentation": ["error", 2],
"max-len": ["warning", 79],
"no-constant": ["error"],

View File

@ -13,10 +13,9 @@ import "../token/ERC20/MintableToken.sol";
*/
contract SampleCrowdsaleToken is MintableToken {
// solium-disable-next-line uppercase
string public constant name = "Sample Crowdsale Token";
string public constant symbol = "SCT"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
string public constant symbol = "SCT";
uint8 public constant decimals = 18;
}

View File

@ -12,9 +12,9 @@ import "../token/ERC20/StandardToken.sol";
*/
contract SimpleToken is StandardToken {
string public constant name = "SimpleToken"; // solium-disable-line uppercase
string public constant symbol = "SIM"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
string public constant name = "SimpleToken";
string public constant symbol = "SIM";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));

View File

@ -9,6 +9,7 @@ import "./ERC165.sol";
* @dev Implements ERC165 using a lookup table.
*/
contract SupportsInterfaceWithLookup is ERC165 {
bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
/**
* 0x01ffc9a7 ===

View File

@ -4,7 +4,15 @@ import "./ERC721Receiver.sol";
contract ERC721Holder is ERC721Receiver {
function onERC721Received(address, address, uint256, bytes) public returns(bytes4) {
function onERC721Received(
address,
address,
uint256,
bytes
)
public
returns(bytes4)
{
return ERC721_RECEIVED;
}
}

View File

@ -147,7 +147,8 @@ contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, ERC721 {
uint256 lastToken = ownedTokens[_from][lastTokenIndex];
ownedTokens[_from][tokenIndex] = lastToken;
ownedTokens[_from].length--; // This also deletes the contents at the last position of the array
ownedTokens[_from].length--;
// ^ This also deletes the contents at the last position of the array
// Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
// be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping