Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 2.68 KB

File metadata and controls

21 lines (11 loc) · 2.68 KB

Practical Implications for Developers: Key Considerations

Developers migrating from Ethereum or building new dApps on VeChainThor must consider these differences:

  1. Transaction Structure:

Ethereum transactions are incompatible with VeChainThor. Developers must construct transactions using the VeChainThor format. Libraries provided in vechain-sdk-j are essential for this. Here follows the transaction body structure:

FieldTypeJSON KeyDescription
ChainTagbytechainTagIdentifies the blockchain network the transaction is targeting.
BlockRefstringblockRefReference to a specific block to maintain ordering and prevent replay attacks.
Expirationuint32expirationNumber of blocks until the transaction expires.
Clauses[]*JSONClauseclausesArray of operation clauses (each clause represents a contract call or transfer).
GasPriceCoefuint8gasPriceCoefMultiplier adjusting the base gas price, affecting transaction priority.
Gasuint64gasMaximum amount of gas allocated for execution.
Originthor.AddressoriginAddress initiating the transaction.
Delegator*thor.Addressdelegator(Optional) If present, indicates a delegator executing on behalf of origin.
Noncemath.HexOrDecimal64nonceA unique number preventing transaction replay attacks.
DependsOn*thor.Bytes32dependsOn(Optional) Specifies a dependency on another transaction’s hash.
  1. RPC Compatibility and the SDK RPC Proxy:

The SDK RPC Proxy offers partial Ethereum JSON-RPC compatibility. Not all methods are supported, and some have different behaviors or limitations. Consult the official VeChainThor documentation for the updated list of supported methods (see Section RPC Methods).

  1. Gas Calculation and VTHO:

Gas costs are paid in VTHO, not VET. Developers need to ensure their accounts have sufficient VTHO. Use VeChainThor-specific APIs to estimate VTHO costs. A feeDelegation service can be used to overcome the need, and the specific provider configuration is supported in the VeChain SDK.

  1. Smart Contract Compilation:

VeChainThor supports Solidity up to the Paris EVM version.