Open obycode opened 1 year ago
In Clarity 2, we should be able to store a trait in a tuple and then extract it and use it as any other trait.
(define-trait trait-foo ((foo () (response uint uint)))) (define-public (call-foo-tuple (t { address: <trait-foo>, amount: uint })) (contract-call? (get address t) foo) )
For the above contract, the type-checker reports missing contract name for call. As a workaround, the trait can be called indirectly by passing it first in a function call.
missing contract name for call
(define-private (call-foo (f <trait-foo>)) (contract-call? f foo) ) (define-public (call-foo-tuple-indirect (t { address: <trait-foo>, amount: uint })) (call-foo (get address t)) )
Corresponding issue: https://github.com/stacks-network/stacks-blockchain/issues/3566
In Clarity 2, we should be able to store a trait in a tuple and then extract it and use it as any other trait.
For the above contract, the type-checker reports
missing contract name for call
. As a workaround, the trait can be called indirectly by passing it first in a function call.Corresponding issue: https://github.com/stacks-network/stacks-blockchain/issues/3566