Skip to main content

E0061: resume outside a utxo

A resume statement hands control back to the yield point a UTXO is suspended at, so it only has meaning inside a utxo. It cannot appear in a top-level function, a script fn, a token, or a test.

Example (error)​

fn example() {
resume;
}

Fix​

Move the resume into a method of the utxo it should advance, such as an ABI implementation or a pub fn:

abi Step {
fn step();
}

utxo Example {
main fn new() {
yield(Step);
}

impl Step {
fn step() {
resume;
}
}
}