# How to pass not hard coded addrresses in predicate?

**URL:** <https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468>\
**Category:** TypeScript SDK\
**Created:** [April 27, 2023, 8:11am UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468 "2023-04-27T08:11:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sway](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sway/32/103_2.png) [@sway](https://forum.fuel.network/u/sway)\
**Post date:** [April 27, 2023, 8:11am UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/1 "2023-04-27T08:11:14Z")

</div>

I hound some tutorial how to deploy and use predicate in ts docs - [link](https://fuellabs.github.io/fuels-ts/guide/predicates/send-and-spend-funds-from-predicates.html#send-and-spend-funds-from-predicates)

In this tutorial public keys are hardcoded and then predicate was builded, is there any way to build it with external variable and passing those variables when new Predicate instance is created?

---

<div class="post-metadata">

**Author:** ![fuelFalcon](https://avatars.discourse-cdn.com/v4/letter/f/e47c2d/32.png) [@fuelFalcon](https://forum.fuel.network/u/fuelFalcon)\
**Post date:** [May 2, 2023, 5:54pm UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/2 "2023-05-02T17:54:07Z")

</div>

The TypeScript SDK can certainly pass in a parameter of a Public Key at call time, but that would result in a security issue as anyone could pass in their desired public key.

We do, however have a roadmap item for [Configurable Constants](https://rust.fuel.network/v0.41.0/contracts/configurable-constants.html), much like the Rust-SDK, see the issue for [Configure Time Constants here](https://github.com/FuelLabs/fuels-ts/issues/529).

---

<div class="post-metadata">

**Author:** ![furnic](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@furnic](https://forum.fuel.network/u/furnic)\
**Post date:** [May 2, 2023, 6:07pm UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/3 "2023-05-02T18:07:08Z")

</div>

You can use a “configurable” block in your predicate in the same way you would for a contract. Then you can use the SDK (Rust, not sure about TS) to set the values dynamically.  
[https://rust.fuel.network/master/getting-started/predicates.html?highlight=configurable#configurable-constants](https://rust.fuel.network/master/getting-started/predicates.html?highlight=configurable#configurable-constants)

---

<div class="post-metadata">

**Author:** ![sway](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sway/32/103_2.png) [@sway](https://forum.fuel.network/u/sway)\
**Post date:** [May 3, 2023, 12:08pm UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/4 "2023-05-03T12:08:44Z")

</div>

oh, thanks for answer  
is there any links with examples in fuel labs github?

---

<div class="post-metadata">

**Author:** ![furnic](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@furnic](https://forum.fuel.network/u/furnic)\
**Post date:** [May 5, 2023, 5:55pm UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/5 "2023-05-05T17:55:25Z")

</div>

Probably the link above to the SDK book is the best example.

---

<div class="post-metadata">

**Author:** ![danielbate](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/danielbate/32/1617_2.png) [@danielbate](https://forum.fuel.network/u/danielbate)\
**Post date:** [May 8, 2023, 9:44am UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/6 "2023-05-08T09:44:36Z")

</div>

I appreciate this is not suitable for the desired use case, but I just also want to share this link to the TS documentation, demonstrating [how arguments are passed to a predicate](https://fuellabs.github.io/fuels-ts/guide/predicates/#calling-a-predicate-with-a-main-function-that-takes-arguments), for those that end up at this post for that reason.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [May 29, 2023, 5:45am UTC](https://forum.fuel.network/t/how-to-pass-not-hard-coded-addrresses-in-predicate/2468/7 "2023-05-29T05:45:05Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
