Closed TremendouslyHighFrequency closed 1 year ago
The ErgoTree in the input box decompiles to the following code(excerpt):
val v1 = OUTPUTS(0)
val v5 = SELF.tokens
val v6 = v5.size
...
val v8 = v1.tokens
val v9 = v8.slice(0, v6)
Since there are no tokens in the first output box(v8 has an empty collection), the slice fails. I suspect that in the case of you running this operation on the node, the transaction is constructed so that the first output box has some tokens in it.
Since there are no tokens in the first output box(v8 has an empty collection), the slice fails. I suspect that in the case of you running this operation on the node, the transaction is constructed so that the first output box has some tokens in it.
Unfortunately, this is not the case. Here is a formation of a successful tx made to the same contract, done by Krasavice through a node: https://explorer.ergoplatform.com/en/transactions/effa18f650754950cb0387ef69ca64ca0569c1eb8d81802aafbbc91f8031ac66
As you can see, output(0) contains no token array (please note that this was a test different from my own, so the inputBox and contract address have changed slightly in my example due to arbitrary uniqueness conditions in the contract
You are right! I suspect the Scala version returns an empty collection when a slice is called with an out-of-bounds range. I'll look into it ASAP.
You are right! I suspect the Scala version returns an empty collection when a slice is called with an out-of-bounds range. I'll look into it ASAP.
Hello sir,
it notes that this is fixed. How would we go about updating nautilus to be updated if it relies on ergo-lib-wasm-browser 24.1 presently?
I'm going to publish a release on Monday.
I'm going to publish a release on Monday.
Thank you Greenhat!
@TremendouslyHighFrequency https://github.com/ergoplatform/sigma-rust/releases/tag/ergo-lib-v0.25.0
This bug is strange. Using a node, a tx can be formed and passed to chain, but using fleet-SDK the same tx gives the following error below. When i posted this as an issue in fleet-sdk github, it was mentioned that this bug was likely sigma-rust and not in the scope of fleet.
The scope of the contract is that the user is withdrawing their token from the contract, which is allowed.
The contract has been proven working through a node/swagger, but does not work with fleet / nautilus
{ "code": 1, "info": "Transaction signing error: Prover error (tx input index 0): Evaluation error: error: Slice: indices 0..1 out of bounds for collection size 0" }
here is the json of the tx: