-
Notifications
You must be signed in to change notification settings - Fork 484
Closed
Description
OS / Environment
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
Manticore version
Version: 0.2.5
Python version
Python 3.6.5
Summary of the problem
Manticore doesn't handle "address.transfer/send" correctly from etherless contracts. It reports STOP and ignores all code after the transfer.
Step to reproduce the behavior
Solidity contract:
pragma solidity ^0.4.18;
contract Test {
constructor() public payable{}
function() public payable{}
function sendEth(address dest, uint amount) public {
//revert();
dest.transfer(amount); // send also fails to revert..
dest.send(amount); // send also fails to revert..
revert();
}
}
python code:
from manticore.ethereum import ManticoreEVM, ABI
m = ManticoreEVM()
m.verbosity(3)
with open('Test.sol') as f:
merged_source = f.read()
user_account = m.create_account(balance=1000)
deadface = m.create_account(balance=10000,address=0x00000000000000000000000000000000deadface)
deadbeef = m.create_account(balance=10000,address=0x00000000000000000000000000000000deadbeef)
# Initialize contract
test_contract = m.solidity_create_contract(merged_source,
owner=user_account,
contract_name="Test",
balance=0) # balance=100
test_contract.sendEth(deadbeef.address,10,caller=deadface.address)
m.finalize()
Expected behavior
Transactions No. 1
Type: CALL (0)
From: normal1(0xdeadface)
To: contract0(0xafb6d63079413d167770de9c3f50db6477811bdb)
Value: 0
Gas used: 281474976710655
Data: 0x49dcbc5e00000000000000000000000000000000000000000000000000000000deadbeef000000000000000000000000000000000000000000000000000000000000000a
Return_data: 0x
Function call:
sendEth(3735928559,10) -> REVERT
Actual behavior
Transactions No. 1
Type: CALL (0)
From: normal1(0xdeadface)
To: contract0(0xafb6d63079413d167770de9c3f50db6477811bdb)
Value: 0
Gas used: 281474976710655
Data: 0x49dcbc5e00000000000000000000000000000000000000000000000000000000deadbeef000000000000000000000000000000000000000000000000000000000000000a
Return_data: 0x
Function call:
sendEth(3735928559,10) -> STOP
Metadata
Metadata
Assignees
Labels
No labels