Skip to content

Commit

Permalink
Eliminate deprecation warning in solidity_create_contract. (#1692)
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius authored May 5, 2020
1 parent 0bdcea4 commit 4746e5d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions manticore/ethereum/manticore.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,18 @@ def solidity_create_contract(
f"Can't create solidity contract with balance ({balance}) "
f"different than 0 because the contract's constructor is not payable."
)
if not Z3Solver.instance().can_be_true(
self.constraints,
Operators.UGE(self.world.get_balance(owner.address), balance),
):
raise EthereumError(
f"Can't create solidity contract with balance ({balance}) "
f"because the owner account ({owner}) has insufficient balance."
)

for state in self.ready_states:
world = state.platform

if not Z3Solver.instance().can_be_true(
self.constraints,
Operators.UGE(world.get_balance(owner.address), balance),
):
raise EthereumError(
f"Can't create solidity contract with balance ({balance}) "
f"because the owner account ({owner}) has insufficient balance."
)

contract_account = self.create_contract(
owner=owner,
Expand Down

0 comments on commit 4746e5d

Please sign in to comment.