ethpm / escape-truffle

Ethereum Package Registry (Truffle)
10 stars 8 forks source link

Visibility warning for assembly method #1

Closed cgewecke closed 6 years ago

cgewecke commented 6 years ago

PackageIndex's fetchString method uses an assembly call.

ethpm/escape-truffle/contracts/PackageIndex.sol:367:18: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
      success := call( //Fetch string size
                 ^ (Relevant source part starts here and spans across multiple lines).
ethpm/escape-truffle/contracts/PackageIndex.sol:377:31: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
      success :=  and(success,call(sub(gas,4000),codeAddress, 0,
                              ^ (Relevant source part starts here and spans across multiple lines).
pipermerriam commented 6 years ago

That entire method and the surrounding shenanigans for returning dynamic length values can be done away with if we move to a newer version of solidity (since returning dynamic length data is now supported).

cgewecke commented 6 years ago

@pipermerriam Ah yes! Thank you :)

cgewecke commented 6 years ago

25