Skip to content

Latest commit

 

History

History
72 lines (37 loc) · 2.75 KB

32064a14ce10d95d4b7343054cc19d73b25b16ae61a6c681011ca781a60c7923.md

File metadata and controls

72 lines (37 loc) · 2.75 KB

DAO

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.

1

Requesting index is out of boundary. This typically happens when a transaction has 3 inputs, but you are requesting for the 4th one.

2

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.

-1

Unknown error.

-2

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.

-4

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.

-10

Buffer not enough. The block header is too large to be loaded into the buffer.

-11

Encoding error. Typically happens when the data fail molecule's parsing checks, or the data passed in surpasses the script's maximum allowed limit.

-12

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.

-13

Overflow. An arithmetic overflow when computing capacity.

-14

Invalid withdraw block. The deposited block number must match the actual deposited block.

-15

Incorrect capacity. The sum of capacities in output cells, cannot exceed the sum of capacities in all input cells with Nervos DAO issurance considered.

-16

Incorrect epoch. This should never happen. It means that the script fails to parse the epoch field in the block header.

-17

Incorrect since. NervosDAO requires DAO input field to have a since value represented via absolute epoch number.

-18

Too many output cells. For simplicity we are limiting to 64 output cells at most, so we can use simple bit masking.

-19

Newly created cell. For newly deposited cells, we need to validate that the cell data part contains 8 bytes of data filled with 0.

-20

Invalid withdrawing cell. The withdrawing cell does not matches the hash.

-21

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.