Deploy contract successed but "Address not contract address"


Here is my contract:

The deploy result:


{"error":{"code":-5,"data":null,"message":"Address not contract address"},"id":1,"jsonrpc":"2.0"}

But when remove the last transition it still worked. I didn’t image how could this happen. Please help!!!

transition setHolderStatus(holder: ByStr20, b: Bool)
    isAuthorized = checkContractOwner owner _sender;
    match isAuthorized with
    | True =>
        contractHolderMap[holder] := b;
        (* Emit success event *)
        e = {_eventname: "setHolderStatus successful"; by: _this_address; recipient: _sender; approved: b};
        event e
    | False =>
        (* Unauthorized transaction - sender is not the contract owner*)
        e = let raisedAt = "setHolderStatus" in makeErrorEvent raisedAt code_not_authorized;
        event e

I checked again. If I keep above transition but remove other, it worked too.
And some relative with cumulative_gas.



It like the limit gas usage is 21001 ?!?


I checked zilliqa code and see

    if (tx.GetCode().size() > MAX_CODE_SIZE_IN_BYTES) {
      throw JsonRpcException(RPC_VERIFY_REJECTED, "Code size is too large");

It mean maximum code length is 20kb
That’s reason.
I must to say it too small for a complex contract


I found a workaround is to strip the deployed contract’s code of comments. However, it is not ideal for people reading the contract from GetSmartContractCode api.

We are thinking of ways to solve this, while ensuring that packet size will not be too huge that it will hinder the consensus process. (as pBFT is extremely time-sensitive)