slither icon indicating copy to clipboard operation
slither copied to clipboard

[Bug-Candidate]: too-many-digits check flagging use of type(BeaconProxy).creationCode

Open jordyn opened this issue 3 years ago • 1 comments

Describe the issue:

The too-many-digits check is flagging the use of bytes memory creationCode = type(BeaconProxy).creationCode;.

As no digits are involved in this code it shouldn't be flagged at all.

Code example to reproduce the issue:


pragma solidity ^0.8.2;
import '@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol';

contract C {
  struct S {
      address o;
  }

  function test() public returns (bytes memory){
      bytes memory code = type(BeaconProxy).creationCode;

      return code;
  }
}

Version:

0.8.3

Relevant log output:

C.test() (test_contract.sol#9-13) uses literals with too many digits:
	- code = type()(BeaconProxy).creationCode (test_contract.sol#10)

jordyn avatar Jun 01 '22 22:06 jordyn

We should make this a SolidityCall to creationCode with an argument of the initcode. Also for runtimeCode, too

0xalpharush avatar Sep 26 '23 14:09 0xalpharush