This script provides NervosDAO on chain script implementation.
This version is deployed in the Lina and Aggron geneiss block and the source code can be found here.
Requesting index is out of boundary. This typically happens when a transaction has 3 inputs, but you are requesting for the 4th one.
Item missing. When requesting certain optional elements this can happen. For example, some cell might not have type scripts. If the script requires a type script but the prepared transaction doesn't have one, this will be returned.
Unknown error.
Wrong number of arguments. NervosDAO script requires script args part to be empty, this way we can ensure that all DAO related scripts in a transaction is mapped to the same group, and processed together in one execution.
Syscall error. Happens when a syscall fails to load the requested data. When this happens, it's best to re-check the transaction to make sure it follows the enclosing scripts requirements, typical reasons include invalid cell data length/format, missing type scripts, missing required witnesses, etc.
Buffer not enough. The block header is too large to be loaded into the buffer.
Encoding error. Typically happens when the data fail molecule's parsing checks, or the data passed in surpasses the script's maximum allowed limit.
Witness too long. The system script has a fixed upper bound on the accepted witness size(32K right now). If your witness is too big(for example, an attacker includes too much witness data), this would be returned.
Overflow. An arithmetic overflow when computing capacity.
Invalid withdraw block. The deposited block number must match the actual deposited block.
Incorrect capacity. The sum of capacities in output cells, cannot exceed the sum of capacities in all input cells with Nervos DAO issurance considered.
Incorrect epoch. This should never happen. It means that the script fails to parse the epoch field in the block header.
Incorrect since. NervosDAO requires DAO input field to have a since value represented via absolute epoch number.
Too many output cells. For simplicity we are limiting to 64 output cells at most, so we can use simple bit masking.
Newly created cell. For newly deposited cells, we need to validate that the cell data part contains 8 bytes of data filled with 0.
Invalid withdrawing cell. The withdrawing cell does not matches the hash.
Script too long. The system script has a fixed upper bound on the accepted serialized script size(32K right now). If your script is too big(for example, an attacker includes too much script arg data), this would be returned.