|
|
@ -38,13 +38,14 @@ class Account: |
|
|
|
def add_balance(self, balance): |
|
|
|
def add_balance(self, balance): |
|
|
|
self.balance += balance |
|
|
|
self.balance += balance |
|
|
|
|
|
|
|
|
|
|
|
def get_storage(self, index): |
|
|
|
# def get_storage(self, index): |
|
|
|
if index in self.storage.keys(): |
|
|
|
# return BitVec("storage_" + str(index), 256) |
|
|
|
return self.storage[index] |
|
|
|
# if index in self.storage.keys(): |
|
|
|
else: |
|
|
|
# return self.storage[index] |
|
|
|
symbol = BitVec("storage_" + str(index), 256) |
|
|
|
# else: |
|
|
|
self.storage[index] = symbol |
|
|
|
# symbol = BitVec("storage_" + str(index), 256) |
|
|
|
return symbol |
|
|
|
# self.storage[index] = symbol |
|
|
|
|
|
|
|
# return symbol |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def as_dict(self): |
|
|
|
def as_dict(self): |
|
|
@ -83,6 +84,7 @@ class Environment: |
|
|
|
def __str__(self): |
|
|
|
def __str__(self): |
|
|
|
return str(self.as_dict) |
|
|
|
return str(self.as_dict) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def as_dict(self): |
|
|
|
def as_dict(self): |
|
|
|
return dict(active_account=self.active_account, sender=self.sender, calldata=self.calldata, |
|
|
|
return dict(active_account=self.active_account, sender=self.sender, calldata=self.calldata, |
|
|
@ -150,7 +152,7 @@ class GlobalState: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __copy__(self): |
|
|
|
def __copy__(self): |
|
|
|
accounts = self.accounts |
|
|
|
accounts = copy(self.accounts) |
|
|
|
environment = copy(self.environment) |
|
|
|
environment = copy(self.environment) |
|
|
|
mstate = deepcopy(self.mstate) |
|
|
|
mstate = deepcopy(self.mstate) |
|
|
|
call_stack = copy(self.call_stack) |
|
|
|
call_stack = copy(self.call_stack) |
|
|
|