Relative Content

Tag Archive for solidity

Type type(contract AggregatorV3Interface) is not implicitly convertible to expected type contract AggregatorV3Interface

TypeError: Type type(contract AggregatorV3Interface) is not implicitly convertible to expected type contract AggregatorV3Interface. –> contracts/FundMe.sol:21:10: | 21 | AggregatorV3Interface priceFeed = AggregatorV3Interface; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here’s my code: function getVersion() internal view returns (uint256) { AggregatorV3Interface priceFeed = AggregatorV3Interface; return priceFeed.version(); } i dont know i still cant figure that out solidity 1 An interface type […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]

why findIndex can not get correct result

// SPDX-License-Identifier: MIT pragma solidity ^0.8.27; library ArrayLib { function find(uint[] storage arr, uint num) internal view returns (uint) { for(uint i =0; i< arr.length; i++) { if(arr[i] == num) { return i; } } revert(“not found”); } } contract TestArray { uint[] public arr = [1,2,3,4]; function findIndex(uint num) external view returns (uint) { […]