Complex tx example dApp
@SilentCicero has requested a complex example dApp to support devrel:
It should have the following spec
- Templated with
create fuelsfor local development support - Replace the counter contract with a token minter contract (multi asset example in sway-playground for context)
- Introduce 4 predicates in 4 additional, separate workspaces. Each predicate can be very simple as follows:
predicate;
configurable {
INDEX: u64 = 1,
}
fn main(input: u64) -> boolean {
input === INDEX
}
- In the dApp, it should send the following transactions which will produce a 3 kinds (two fungible / one NFT) of tokens to specific predicate addresses:
- Send/mint fungible 10,000 asset A to predicate A
- Send/mint fungible 10,000 asset B to predicate A
- Send/mint fungible 5000 asset A to predicate B
- Send/mint fungible 5000 asset B to predicate C
- Send/mint 1 non-fungible asset to predicate D
- Create a tx that utilises and attempts to spend all the assets from the previous txs via the predicate code.
Discussed in our weekly sync on 29-07-2024, but as suggested by @danielbate and @arboleya perhaps the before creating another example dApp, given we currently already maintain two, we could explore the possibility of covering such an advanced use case in the cookbook, similar to how we conduct such a complex transaction using doc snippets such as one with multiple signers. This example essentially highlights a complex use of scripts and multiple UTXOs. At the very least this could the precursor for the example dApp.
Given the above comment and #2864, moving this to p2
@danielbate If #2864 suffices, we can safely close this issue.