// Copyright (c) 2018 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.

// To compile the proto, run:
//      protoc --go_out=plugins=grpc:$GOPATH/src *.proto
syntax = "proto3";
package iotextypes;
option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes";
option java_multiple_files = true;
option java_package = "com.github.iotexproject.grpc.types";


// BELOW ARE DEFINITIONS FOR EVM ERROR CLASSIFICATION IN RECEIPT STATUS 
enum ReceiptStatus {
  Failure              = 0;
  Success              = 1;

  //1xx for EVM ErrorCode
  ErrUnknown                        = 100;
  ErrOutOfGas                       = 101;
  ErrCodeStoreOutOfGas              = 102;
  ErrDepth                          = 103;
  ErrContractAddressCollision       = 104;
  ErrNoCompatibleInterpreter        = 105;
  ErrExecutionReverted              = 106;
  ErrMaxCodeSizeExceeded            = 107;
  ErrWriteProtection                = 108;
  ErrInvalidSubroutineEntry         = 109;
  ErrInsufficientBalance            = 110;
  ErrInvalidJump                    = 111;
  ErrReturnDataOutOfBounds          = 112;
  ErrGasUintOverflow                = 113;
  ErrInvalidRetsub                  = 114;
  ErrReturnStackExceeded            = 115;
  ErrInvalidCode                    = 116;

  //2xx for Staking ErrorCode
  ErrLoadAccount                    = 200;
  ErrNotEnoughBalance               = 201;
  ErrInvalidBucketIndex             = 202;
  ErrUnauthorizedOperator           = 203;
  ErrInvalidBucketType              = 204;
  ErrCandidateNotExist              = 205;
  ErrReduceDurationBeforeMaturity   = 206;
  ErrUnstakeBeforeMaturity          = 207;
  ErrWithdrawBeforeUnstake          = 208;
  ErrWithdrawBeforeMaturity         = 209;
  ErrCandidateAlreadyExist          = 210;
  ErrCandidateConflict              = 211;
  ErrInvalidBucketAmount            = 212;
  ErrWriteAccount                   = 213;
  ErrWriteBucket                    = 214;
  ErrWriteCandidate                 = 215;
}
