Skip to content
Open
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
4 changes: 2 additions & 2 deletions docs/api/http/smart-contract/deploycontract.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deploy a smart contract. Returns the unsigned deployment transaction.
| Field | Type | Required | Description |
|---|---|---|---|
| `owner_address` | string | Yes | Deployer address |
| `name` | string | No | Contract name |
| `name` | string | No | Contract name; it must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding |
| `abi` | json string | No | Contract ABI (JSON-array string) |
| `bytecode` | string | Yes | Contract bytecode (hex) |
| `parameter` | string | No | Constructor parameters (hex, appended to bytecode) |
Expand Down Expand Up @@ -102,4 +102,4 @@ Response example (real Nile capture):
| `consume_user_resource_percent` not in [0, 100] | `{"Error": "class org.tron.core.exception.ContractValidateException : percent must be >= 0 and <= 100"}` |
| Other exceptions | `{"Error": "<exceptionClass> : <message>"}` |

> Deployment-side errors (e.g. insufficient origin energy, oversized contract code, constructor revert) are only triggered during broadcast or block packing, not by this endpoint.
> Deployment-side errors (e.g. insufficient origin energy, oversized contract code or contract name, constructor revert) are only triggered during broadcast or block packing, not by this endpoint.
2 changes: 1 addition & 1 deletion docs/api/json-rpc/tx-build/buildTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Tron private extension. Constructs an **unsigned** Tron transaction; sign it and
| `tokenId` | `0` | TRC-10 token id (used for `TransferAssetContract`) |
| `tokenValue` | `0` | TRC-10 amount |
| `abi` | `""` | ABI JSON string for contract deployment (e.g. `[{...}]`) |
| `name` | `""` | Contract name when deploying |
| `name` | `""` | Contract name when deploying; it must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding |
| `consumeUserResourcePercent` | `0` | User-shared resource percentage (0–100) |
| `originEnergyLimit` | `0` | Deployer's max energy per call |
| `permissionId` | `0` | Multi-sig permission id |
Expand Down
10 changes: 5 additions & 5 deletions docs/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"description": "Machine-readable definition generated from java-tron source code, with human-facing metadata linked to the markdown API documentation."
"x-java-tron-source":
"repo": "tronprotocol/java-tron"
"commit": "f8ff7c76f45ab41d9bb76922329657506819701b"
"version": "GreatVoyage-v4.8.2"
"commit": "d5c3d1d1fd0cad12f09c4346d6ac937ab2cbb071"
"version": "GreatVoyage-v4.8.2.2"
"servers":
-
"url": "https://nile.trongrid.io"
Expand Down Expand Up @@ -13256,7 +13256,7 @@
"description": "Percentage of contract execution resource cost paid by the user."
"name":
"type": "string"
"description": "Name encoded as expected by java-tron."
"description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters."
"origin_energy_limit":
"type": "integer"
"format": "int64"
Expand Down Expand Up @@ -14261,7 +14261,7 @@
"description": "Contract parameter payload."
"name":
"type": "string"
"description": "Name encoded as expected by java-tron."
"description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters."
"call_value":
"type": "integer"
"format": "int64"
Expand Down Expand Up @@ -16669,7 +16669,7 @@
"description": "Percentage of contract execution resource cost paid by the user."
"name":
"type": "string"
"description": "Name encoded as expected by java-tron."
"description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters."
"origin_energy_limit":
"oneOf":
-
Expand Down
6 changes: 3 additions & 3 deletions docs/api/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"description": "Machine-readable definition generated from java-tron source code, with human-facing metadata linked to the markdown API documentation.",
"x-java-tron-source": {
"repo": "tronprotocol/java-tron",
"commit": "f8ff7c76f45ab41d9bb76922329657506819701b",
"version": "GreatVoyage-v4.8.2"
"commit": "d5c3d1d1fd0cad12f09c4346d6ac937ab2cbb071",
"version": "GreatVoyage-v4.8.2.2"
}
},
"servers": [
Expand Down Expand Up @@ -2328,7 +2328,7 @@
},
"name": {
"type": "string",
"description": "Name encoded as expected by java-tron."
"description": "Contract name for deployment. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters."
},
"permissionId": {
"type": "integer",
Expand Down
4 changes: 4 additions & 0 deletions docs/api/rpc/smart-contract/DeployContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ Deploy a smart contract. Returns an unsigned deployment transaction.
rpc DeployContract (CreateSmartContract) returns (TransactionExtention) {}
```

When constructing `CreateSmartContract`, ensure that `new_contract.name` is no more than 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters. For example, most Chinese characters use three bytes each in UTF-8.

Leave `new_contract.code_hash` and `new_contract.trx_hash` empty. These fields are reserved for values set by the node; after the `VERSION_4_8_2_2` upgrade takes effect, deployment fails if either field is non-empty.

See the corresponding HTTP endpoint at [/wallet/deploycontract](../../http/smart-contract/deploycontract.md).
2 changes: 1 addition & 1 deletion docs/api/specs/json-rpc/buildTransaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
},
"name": {
"type": "string",
"description": "Name encoded as expected by java-tron."
"description": "Contract name for deployment. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters."
},
"permissionId": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion docs/clients/wallet-cli/java/commands/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Deploy, trigger, and inspect smart contracts.
```

- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
- `contractName` — name of the smart contract.
- `contractName` — name of the smart contract, with a maximum length of 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters.
- `ABI` — compile-generated ABI code.
- `byteCode` — compile-generated byte code.
- `constructor`, `params`, `isHex` — define the format of the bytecode, which determines the way to parse `byteCode` from parameters.
Expand Down
6 changes: 3 additions & 3 deletions docs/contracts/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ message SmartContract {
- `bytecode`: smart contract byte code
- `call_value`: TRX transferred into smart contract while call the contract
- `consume_user_resource_percent`: resource consumption percentage set by the developer
- `name`: smart contract name
- `name`: smart contract name. It must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters
- `origin_energy_limit`: energy consumption of the developer limit in one call, must be greater than 0. For old contracts that were deployed without this parameter, the stored value is 0 but the runtime substitutes a default of 10,000,000 energy (`CREATOR_DEFAULT_ENERGY_LIMIT`); developers can use the `updateEnergyLimit` api to update this parameter (the new value must be greater than 0)
- `code_hash`: hash of the contract runtime bytecode
- `trx_hash`: root transaction id of the deployment. Populated only for contracts deployed via the `CREATE2` opcode; left empty for contracts deployed via the `CREATE` opcode or via gRPC `deployContract`
- `code_hash`: the hash of the deployed contract's runtime bytecode. The node calculates this field automatically, so callers constructing `CreateSmartContract` must leave it empty. After the `VERSION_4_8_2_2` upgrade takes effect, supplying a non-empty value causes deployment to fail
- `trx_hash`: for a contract created through the TVM `CREATE2` opcode, the node sets this field to the root transaction ID. It remains empty for contracts created through `CREATE` or the `DeployContract` API. Callers constructing `CreateSmartContract` must leave it empty; after the `VERSION_4_8_2_2` upgrade takes effect, supplying a non-empty value causes deployment execution to fail
- `version`: smart contract version. When the network has activated the `ALLOW_TVM_COMPATIBLE_EVM` proposal, newly deployed contracts are stamped with version 1 so the runtime can gate EVM-compatible behavior to them, while older contracts (deployed before activation) keep version 0 and retain the original TVM semantics. As of writing this proposal is not active on mainnet, so all contracts on mainnet have version 0

Through other two grpc message types `CreateSmartContract` and `TriggerSmartContract` to create and use smart contract.
Expand Down
15 changes: 5 additions & 10 deletions docs/developers/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ This page summarizes the GitHub Actions checks that contributors need to underst
| --- | --- | --- | --- |
| PR Check (`pr-check.yml`) | `develop`, `release_**` | Runs | Push to `master` or `release_**` |
| PR Build (`pr-build.yml`) | `master`, `develop`, `release_**` | Skipped | Manual dispatch |
| Single-node integration (`integration-test-single-node.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch |
| Multi-node integration (`integration-test-multinode.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch |
| Single-node integration (smoke) (`integration-test-single-node.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch |
| CodeQL (`codeql.yml`) | `develop` | Skipped | Push to `develop`, `master`, or `release_**`; weekly schedule |
| Math usage (`math-check.yml`) | `develop`, `release_**` | Runs | Push to `master` or `release_**`; manual dispatch |
| Reviewer assignment (`pr-reviewer.yml`) | `develop`, `release_**` | Runs | None |
| Cancel PR workflows (`pr-cancel.yml`) | Any branch | Runs when an unmerged PR is closed | None |

PR Build, both integration-test workflows, and CodeQL are skipped when a pull request changes only documentation or certain repository-metadata files. If the same pull request includes any other file, the applicable workflows run normally. PR Check, Math usage, reviewer assignment, and cancellation do not have this path exclusion.
PR Build, the single-node integration (smoke) workflow, and CodeQL are skipped when a pull request changes only documentation or certain repository-metadata files. If the same pull request includes any other file, the applicable workflows run normally. PR Check, Math usage, reviewer assignment, and cancellation do not have this path exclusion.

## PR Validation and Code Checks

Expand Down Expand Up @@ -48,12 +47,9 @@ The coverage gates require:

## Integration, Security, and Math Checks

The documented source version includes both full integration-test workflows:
The documented source version includes a single-node integration workflow that runs the smoke-test subset against one node. The full single-node suite and the multi-node integration workflow are not run by GitHub Actions.

- The single-node workflow runs the full test set against one node.
- The multi-node workflow runs the full test set against a three-witness stack.

They run for applicable pull requests targeting `develop` or `release_**`, on pushes to `master` or `release_**`, and when started manually.
The smoke workflow runs for applicable pull requests targeting `develop` or `release_**`, on pushes to `master` or `release_**`, and when started manually.

CodeQL runs on pull requests targeting `develop` only. It also runs on pushes to `develop`, `master`, and `release_**`, and on a weekly schedule.

Expand All @@ -77,8 +73,7 @@ When a pull request is closed without being merged, java-tron attempts to cancel

- PR Build
- CodeQL
- Single-node integration tests
- Multi-node integration tests
- Single-node integration (smoke)

## Sonar Configuration

Expand Down