4

Does anyone know why introducing a simple line like "Pubkey::new_unique()" inside https://github.com/solana-labs/example-helloworld/blob/master/src/program-rust/src/lib.rs#L22 will make the program fail?

1
  • What is the error you get?
    – Frank C.
    Commented Sep 23, 2022 at 14:45

1 Answer 1

1

The implementation of that function uses global data. Programs cannot use global data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.