我在vyper (SomeContract)中有一个智能契约,它在另一个智能契约中被调用:
some_contract: address = _some_contract
SomeContract(some_contract).foo() # Is there a cost incurred here with SomeContract()?
SomeContract(some_contract).foo()vs
some_contract: SomeContract = SomeContract(_some_contract)
some_contract.foo()
some_contract.foo()是否使用SomeContract(some_contract)获取抽象的成本气体?
这两种版本中哪一种更便宜?
发布于 2020-11-16 13:41:40
不,表达式SomeContract(some_contract)是在编译期间解析的。
它没有任何运行时的影响(气体成本或其他)。
https://ethereum.stackexchange.com/questions/90188
复制相似问题