Skip to content

Instantly share code, notes, and snippets.

@shanefontaine
shanefontaine / marketplace-contracts-mythril.md
Last active September 26, 2018 19:57
Mythril Marketplace Contracts Output

Analysis results for FakeERC20.json

Exception state

  • Type: Informational
  • Contract: FakeERC20
  • Function name: _function_0x23b872dd
  • PC address: 4256

Description

pragma solidity ^0.4.24;
contract Escrow {
event Deposited(address indexed payee, uint256 weiAmount);
event Withdrawn(address indexed payee, uint256 weiAmount);
mapping(address => uint256) private _deposits;
function depositsOf(address payee) public view returns (uint256) {

Script

import os
from subprocess import call

def main():
    extensions = ('.sol')
    for subdir, dirs, files in os.walk("."):
        for file in files:
 ext = os.path.splitext(file)[-1].lower()
function withdraw() public {
_checkWithdrawal();
_token.safeTransfer(_wallet, _token.balanceOf(address(this)));
}
funciton _checkWithdrawal() internal {
// This could be anything relevant. For example:
// 1. require(now > hasClosed());
// 2. require(isFinalized());
// 3. require(numContributors == maxNumContributors);

Keybase proof

I hereby claim:

  • I am shanefontaine on github.
  • I am shanefontaine (https://keybase.io/shanefontaine) on keybase.
  • I have a public key ASAmlUG5W7TZ7BvPBWTlDEw8qfJL1oyE9MsZYGiP1gaM3Ao

To claim this, I am signing this object:

INFO:Detectors:
ERC20Detailed.______gap (openzeppelin-eth/contracts/token/ERC20/ERC20Detailed.sol#45) shadows:
- Initializable.______gap (zos-lib/contracts/Initializable.sol#56)
ERC20.______gap (openzeppelin-eth/contracts/token/ERC20/ERC20.sol#209) shadows:
- Initializable.______gap (zos-lib/contracts/Initializable.sol#56)
Reference: https://github.com/trailofbits/slither/wiki/Detectors-Documentation#state-variable-shadowing
INFO:Detectors:
Initializable.isConstructor (zos-lib/contracts/Initializable.sol#44-53) is declared view but contains assembly code
ECDSA.recover (openzeppelin-eth/contracts/cryptography/ECDSA.sol#18-54) is declared view but contains assembly code
Reference: https://github.com/trailofbits/slither/wiki/Detectors-Documentation#constant-functions-changing-the-state
pragma solidity ^0.5.0;
// Flat ERC20
// Updated Jun 7 2019
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result

INFO:Slither:'truffle compile' running (use --truffle-version truffle@x.x.x to use specific version) Truffle v5.0.7 (core: 5.0.7) Node v11.15.0

INFO:Detectors:

ERC20Detailed.______gap (openzeppelin-eth/contracts/token/ERC20/ERC20Detailed.sol) shadows:
	- Initializable.______gap (zos-lib/contracts/Initializable.sol)
ERC20.______gap (openzeppelin-eth/contracts/token/ERC20/ERC20.sol) shadows:
	- Initializable.______gap (zos-lib/contracts/Initializable.sol)
pragma solidity ^0.4.24;
contract Ownable {
address private _owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
Name Description On-chain Retrival Off-chain Retrieval
Creation Bytecode Code that generates the runtime bytecode type(ContractName).creationCode getTransactionByHash
Runtime Bytecode Code that is stored on-chain that describes a smart contract extcodecopy(a) or type(ContractName).runtimeCode getCode
Bytecode Umbrella term that encompasses both runtime bytecode and creation bytecode NA NA
Deployed Bytecode Same as runtime bytecode extcodecopy(a) or type(ContractName).runtimeCode getCode
Init Code Same as creation bytecode type(ContractName).creationCode getTransactionByHash