diff --git a/.solhint.json b/.solhint.json index 8b6f2fc46..b8826cafd 100644 --- a/.solhint.json +++ b/.solhint.json @@ -8,6 +8,7 @@ "compiler-version":["error", "0.6.10"], "not-rely-on-time": "off", "no-complex-fallback": "off", - "no-inline-assembly": "off" + "no-inline-assembly": "off", + "reason-string": "off" } } diff --git a/contracts/Otoken.sol b/contracts/Otoken.sol index 1f9f6b9a9..c80a816c1 100644 --- a/contracts/Otoken.sol +++ b/contracts/Otoken.sol @@ -66,8 +66,8 @@ contract Otoken is ERC20Initializable { strikePrice = _strikePrice; expiry = _expiry; isPut = _isPut; - (string memory name, string memory symbol) = _getNameAndSymbol(); - __ERC20_init_unchained(name, symbol); + (string memory tokenName, string memory tokenSymbol) = _getNameAndSymbol(); + __ERC20_init_unchained(tokenName, tokenSymbol); } /** @@ -92,10 +92,10 @@ contract Otoken is ERC20Initializable { /** * @notice generate name and symbol for an option - * @return name ETHUSDC 05-September-2020 200 Put USDC Collateral - * @return symbol oETHUSDC-05SEP20-200P + * @return tokenName ETHUSDC 05-September-2020 200 Put USDC Collateral + * @return tokenSymbol oETHUSDC-05SEP20-200P */ - function _getNameAndSymbol() internal view returns (string memory name, string memory symbol) { + function _getNameAndSymbol() internal view returns (string memory tokenName, string memory tokenSymbol) { string memory underlying = _getTokenSymbol(underlyingAsset); string memory strike = _getTokenSymbol(strikeAsset); string memory collateral = _getTokenSymbol(collateralAsset); @@ -109,7 +109,7 @@ contract Otoken is ERC20Initializable { (string memory monthSymbol, string memory monthFull) = _getMonth(month); // concat name string: ETHUSDC 05-September-2020 200 Put USDC Collateral - name = string( + tokenName = string( abi.encodePacked( underlying, strike, @@ -129,7 +129,7 @@ contract Otoken is ERC20Initializable { ); // concat symbol string: oETHUSDC-05SEP20-200P - symbol = string( + tokenSymbol = string( abi.encodePacked( "o", underlying, @@ -170,10 +170,10 @@ contract Otoken is ERC20Initializable { /** * @dev return string of option type - * @return symbol P or C - * @return full Put or Call + * @return shortString P or C + * @return longString Put or Call */ - function _getOptionType(bool _isPut) internal pure returns (string memory symbol, string memory full) { + function _getOptionType(bool _isPut) internal pure returns (string memory shortString, string memory longString) { if (_isPut) { return ("P", "Put"); } else { @@ -183,10 +183,10 @@ contract Otoken is ERC20Initializable { /** * @dev return string of month. - * @return symbol SEP, DEC ...etc - * @return full September, December ...etc + * @return shortString SEP, DEC ...etc + * @return longString September, December ...etc */ - function _getMonth(uint256 _month) internal pure returns (string memory symbol, string memory full) { + function _getMonth(uint256 _month) internal pure returns (string memory shortString, string memory longString) { if (_month == 1) { return ("JAN", "January"); } else if (_month == 2) { diff --git a/contracts/libs/Actions.sol b/contracts/libs/Actions.sol index 4a25ba2fa..d2f2ea4a1 100644 --- a/contracts/libs/Actions.sol +++ b/contracts/libs/Actions.sol @@ -77,20 +77,19 @@ library Actions { } struct WithdrawArgs { - /// @notice The address of the account owner + //The address of the account owner address owner; - /// @notice The index of the vault from which the asset will be withdrawn + // The index of the vault from which the asset will be withdrawn uint256 vaultId; - /// @notice The address to which we transfer the asset + // The address to which we transfer the asset address to; - /// @notice The asset that is to be withdrawn + // The asset that is to be withdrawn address asset; - /** - * @notice Each vault can hold multiple short / long / collateral assets. In this version, we are restricting the scope to only 1 of each. - * In future versions this would be the index of the short / long / collateral asset that needs to be modified. - */ + // Each vault can hold multiple short / long / collateral assets. + // In this version, we are restricting the scope to only 1 of each. + // In future versions this would be the index of the short / long / collateral asset that needs to be modified. uint256 index; - /// @notice The amount of asset that is to be transfered + // The amount of asset that is to be transfered uint256 amount; } @@ -143,7 +142,7 @@ library Actions { * @param _args The general action arguments structure * @return The arguments for a withdraw action */ - function _parseWithdrawArgs(ActionArgs memory _args) internal returns (WithdrawArgs memory) { + function _parseWithdrawArgs(ActionArgs memory _args) internal pure returns (WithdrawArgs memory) { require( (_args.actionType == ActionType.WithdrawLongOption) || (_args.actionType == ActionType.WithdrawCollateral), "Actions: can only parse arguments for withdraw actions" diff --git a/contracts/mocks/MockERC20.sol b/contracts/mocks/MockERC20.sol index d361c0485..86373b891 100644 --- a/contracts/mocks/MockERC20.sol +++ b/contracts/mocks/MockERC20.sol @@ -4,8 +4,8 @@ pragma solidity 0.6.10; import {ERC20Initializable} from "../packages/oz/upgradeability/ERC20Initializable.sol"; contract MockERC20 is ERC20Initializable { - constructor(string memory name, string memory symbol) public { - __ERC20_init_unchained(name, symbol); + constructor(string memory _name, string memory _symbol) public { + __ERC20_init_unchained(_name, _symbol); } function mint(address account, uint256 amount) public { diff --git a/contracts/mocks/MockOtoken.sol b/contracts/mocks/MockOtoken.sol index 93ba51f05..01a54079e 100644 --- a/contracts/mocks/MockOtoken.sol +++ b/contracts/mocks/MockOtoken.sol @@ -30,8 +30,8 @@ contract MockOtoken is ERC20Initializable { strikePrice = _strikePrice; expiry = _expiry; isPut = _isPut; - string memory name = "ETHUSDC/1597511955/200P/USDC"; - string memory symbol = "oETHUSDCP"; - __ERC20_init_unchained(name, symbol); + string memory tokenName = "ETHUSDC/1597511955/200P/USDC"; + string memory tokenSymbol = "oETHUSDCP"; + __ERC20_init_unchained(tokenName, tokenSymbol); } } diff --git a/contracts/tests/UpgradeableContractV1.sol b/contracts/tests/UpgradeableContractV1.sol index a922f5f8b..31df7d35a 100644 --- a/contracts/tests/UpgradeableContractV1.sol +++ b/contracts/tests/UpgradeableContractV1.sol @@ -28,7 +28,7 @@ contract UpgradeableContractV1 is VersionedInitializable { * AddressBook. * @param _addressBook the address of the AddressBook **/ - function initialize(address _addressBook) public initializer { + function initialize(address _addressBook) external initializer { addressBook = _addressBook; } } diff --git a/contracts/tests/UpgradeableContractV2.sol b/contracts/tests/UpgradeableContractV2.sol index d4df18f03..c09072906 100644 --- a/contracts/tests/UpgradeableContractV2.sol +++ b/contracts/tests/UpgradeableContractV2.sol @@ -29,7 +29,7 @@ contract UpgradeableContractV2 is VersionedInitializable { * AddressBook. * @param _addressBook the address of the AddressBook **/ - function initialize(address _addressBook) public initializer { + function initialize(address _addressBook) external initializer { addressBook = _addressBook; } } diff --git a/slither.config.json b/slither.config.json new file mode 100644 index 000000000..e302e9a16 --- /dev/null +++ b/slither.config.json @@ -0,0 +1,3 @@ +{ + "filter_paths": "packages|mocks|tests" +} \ No newline at end of file