Esempio n. 1
0
 def create_ctoken_use(self, node: ast.Call) -> sil.Acc:
     """Create a ``ctoken`` use in contract."""
     target = sil.PythonRefExpression(node.args[0])
     return sil.Acc(sil.PredicateAccess(_CREDIT_PREDICATE_NAME, target))
Esempio n. 2
0
 def get_target(self) -> sil.RefExpression:
     return sil.PythonRefExpression(self._target)
Esempio n. 3
0
 def _translate_level(self, node: ast.Call) -> sil.PermExpression:
     """Translate a call to ``Level``."""
     assert len(node.args) == 1
     arg = sil.PythonRefExpression(node.args[0])
     return self.create_level_call(arg)