Is there a sway library to point to Predicate

Hi. I’m looking for a library for predicates in the sway contracts.

Like in the rust SDK:

use fuels::{accounts::{predicate::Predicate}}

Is that available ?

Hey carlos yes there is! Take a look at this

Hi, I got this error when forc build:

use fuels::{accounts::{predicate::Predicate, Account}};
      ^^^^^^^^^^^^^^^^ Module "fuels::accounts" could not be found.

i use forc 0.42.1

Just to be clear. Not from the rust SDK but inside a contract.

Ah apologies for the confusion. Can you give me more context as to what you’re trying to do?

I am building a multisig predicate that sends funds locked in a contract to a wallet, if a whitelisted address signs (so called sponsor).

For that i can let the contract instantiate the predicate, therefore the question if that is possible and where to find the Predicate library? And if so, how to load the binary file?

I could also make a multi-wallet predicate, but then the contract has to deposit to the predicate address in a separate tx. I prefer the first. So that the multisig is shared between contract and sponsor address.

1 Like

It doesn’t really make sense for a predicate to be “instantiated” by a contract because a predicate is simply an address generated from the byte code.

1 Like