crytic / crytic/slither

Missing import after `slither-flatten --strategy LocalImport`

Open
#532 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi There,

I noticed a missing import when running `slither-flatten --strategy LocalImport` on the `celo` contracts.

How to reproduce:

```bash
# Get the repository
git clone https://github.com/celo-org/celo-monorepo.git
cd celo-monorepo/packages/protocol

# Needs: npm and docker enabled

# Install javascript dependencies
npm i
npm i keccakjs --save
npm i @celo/utils@0.1.14
npm i web3-provider-engine
npm i ts-generator
npm i @celo/typechain-target-web3-v1-celo
npm i

# Testing that everything installed correctly (make sure Docker is enabled at this point)
nvm use 10.16.2 # Need this version to compile contracts
npm test # May result in some errors but that's OK

# Install and run slither analyzer (for flattening purposes only)
cd ..
pipenv install slither-analyzer
pipenv install -e git+https://github.com/crytic/slither.git@dev#egg=slither-analyzer
pipenv run slither-flat celo-monorepo/packages/protocol --strategy OneFile
```

In this process, the `SortedOracles.sol` file goes from having this set of imports:

```javascript
pragma solidity ^0.5.3;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./interfaces/ISortedOracles.sol";
import "../common/FixidityLib.sol";
import "../common/Initializable.sol";
import "../common/linkedlists/AddressSortedLinkedListWithMedian.sol";
import "../common/linkedlists/SortedLinkedListWithMedian.sol";

...
```

to this set of imports:

```javascript
pragma solidity 0.5.16;
import './Initializable.sol';
import './Context.sol';
import './Ownable.sol';
import './ISortedOracles.sol';
import './SafeMath.sol';
import './LinkedList.sol';
import './SortedLinkedList.sol';
import './SortedLinkedListWithMedian.sol';
import './AddressSortedLinkedListWithMedian.sol';

contract SortedOracles is ISortedOracles, Ownable, Initializable {
using SafeMath for uint256;
using AddressSortedLinkedListWithMedian for SortedLinkedListWithMedian.List;
using FixidityLib for FixidityLib.Fraction;
...
```

When compiling the `FixidityLib` library is missing. I've double checked the individual imports and they don't import this library indirectly either so I suspect it's a missing import.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.