Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/update klever proto sc #34

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pants-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{ "id": "CVE-2023-1255", "reason": "[email protected] from reqwest" },
{ "id": "CVE-2023-2975", "reason": "[email protected] from reqwest" },
{ "id": "CVE-2023-3446", "reason": "[email protected] from reqwest" },
{ "id": "CVE-2023-5363", "reason": "[email protected] from reqwest" }
{ "id": "CVE-2023-5363", "reason": "[email protected] from reqwest" },
{ "id": "CVE-2024-0727", "reason": "[email protected] from reqwest" }
]
}
14 changes: 13 additions & 1 deletion packages/kos-proto/proto/klever/contracts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,16 @@ message DepositContract {
bytes ID = 2 [json_name = "ID"];
bytes CurrencyID = 3 [json_name = "CurrencyID"];
int64 Amount = 4 [json_name = "Amount"];
}
}

message SmartContract {
enum SCType {
SCInvoke = 0;
SCDeploy = 1;
}
SCType Type = 1 [json_name = "Type"];
bytes Address = 2 [json_name = "Address"];
// SmartContract CallValue is represented by a map of currencyID and amount
// should be limited to 50 currencies
map<string, int64> CallValue = 3 [json_name = "CallValue"];
}
28 changes: 26 additions & 2 deletions packages/kos-proto/proto/klever/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ message TXContract {
UpdateAccountPermissionContractType = 22;
DepositContractType = 23;
ITOTriggerContractType = 24;
SmartContractType = 99;
}
ContractType Type = 1 [json_name = "Type"];
google.protobuf.Any Parameter = 2 [json_name = "Parameter"];
Expand Down Expand Up @@ -101,8 +102,29 @@ message Transaction {
ITOWhiteListError = 51;
NFTMetadataChangeStopped = 52;
AlreadyExists = 53;

Fail = 99;
IteratorLimitReached = 54;
// FunctionNotFound is returned when the input specifies a function name that does not exist or is not public.
VMFunctionNotFound = 55;
// FunctionWrongSignature is returned when the wrong number of arguments is provided.
VMFunctionWrongSignature = 56;
// UserError is returned for various execution errors.
VMUserError = 57;
// OutOfGas is returned when VM execution runs out of gas.
VMOutOfGas = 58;
// AccountCollision is returned when created account already exists.
VMAccountCollision = 59;
// CallStackOverFlow is returned when stack overflow occurs.
VMCallStackOverFlow = 60;
// Execution Panicked
VMExecutionPanicked = 61;
// ExecutionFailed is returned when the execution of the specified function has failed.
VMExecutionFailed = 62;
// UpgradeFailed is returned when the upgrade of the contract has failed
VMUpgradeFailed = 63;
// SimulateFailed is returned when tx simulation fails execution
VMSimulateFailed = 64;

Fail = 99;
}

message KDAFee {
Expand Down Expand Up @@ -134,4 +156,6 @@ message Transaction {
TXResultCode ResultCode = 4 [json_name = "ResultCode"];
repeated Receipt Receipts = 5 [json_name = "Receipts"];
uint64 Block = 6 [json_name = "Block"];
uint64 GasLimit = 7 [json_name = "GasLimit"];
uint64 GasMultiplier = 8 [json_name = "GasMultiplier"];
}
9 changes: 9 additions & 0 deletions packages/kos-proto/proto/klever/userAccountData.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ message UserAccountData {
uint64 Nonce = 7;

repeated Permission Permissions = 8;

bytes OwnerAddress = 9;
bytes CodeHash = 10;
bytes CodeMetadata = 11;
}

message CodeEntry {
bytes Code = 1;
uint32 NumReferences = 2;
}
Loading