# Introduction

Smart contract development on any blockchain carries development costs covering resource expenditure. However, developing smart contracts on the TRON blockchain is vastly less expensive than Ethereum and similar protocols. This guide presents the comparison in a user-friendly format. If you wish to estimate energy costs for developing smart contract, please go to **<a href="https://tronstation.io/energycalc" target="_blank">Tron Station</a>** which has energy and bandwidth tools can help you.

# Summary

The tables below contrasts the development costs of small-sized contracts, a medium-sized contract, and a large-sized contract between TRON and Ethereum. The two example small contracts are a Simple Storage contract and a Fibonacci contract. The medium-sized contract example is a modified crypto-zombie contract called zombiefactory, while the large-sized contract is another modified crypto-zombie contract called zombieownership. The three cases in which bandwidth and energy consumption occurs are summarized as TRON-1, TRON-2, and TRON-3:

###### Table Denotes
  • **TRON-1**: not using any [bandwidth](🔗) or [energy](🔗) from frozen token

  • **TRON-1** = Energy Fee + Bandwidth Fee

  • **TRON-2**: using [free bandwidth or bandwidth from frozen token](🔗) only

  • **TRON-2** = TRON-1 - Free Bandwidth Quota - Frozen Bandwidth Quota

  • **TRON-3**: using [bandwidth](🔗) and [energy](🔗) from the frozen token

  • **TRON-3** = TRON-2 - Frozen Energy Quota

For examples of freezing TRX for bandwidth and energy gain, please see the <a href="https://github.com/tronprotocol/tron-web/blob/0f4a0fdfb82a058bf38b3cc1c516f417f3231580/examples/node/pages/index.js#L182" target="_blank">example code</a>. For detailed descriptions of the HTTP APIs and TronWeb API functions, please visit the <a href="https://developers.tron.network/reference" target="_blank">API reference</a>.

### Comparison Tables

_**Table 1**_ Comparison of contract development costs between TRON & Ethereum in TRX

CASESmall Contract - aSmall Contract - bMedium ContractLarge ContractUnit
TRON-13.8346.71947.3123.118TRX
TRON-23.8286.71147.272123.046TRX
TRON-30000TRX
Ethereum9.75713.98373.600212.019TRX

<p> _**Table 2**_ Comparison of contract development costs between TRON & Ethereum in USD

CASESmall Contract - aSmall Contract - bMedium ContractLarge ContractUnit
TRON-10.0880.1551.0882.831USD
TRON-20.0880.1541.0872.830USD
TRON-30000USD
Ethereum0.2240.3221.6934.876USD

<p> _**Table 3**_ Comparison of contract development costs between TRON & Ethereum in Kwei

CASESmall Contract - aSmall Contract - bMedium ContractLarge ContractUnit
TRON-10.4410.7735.43914.158Kwei
TRON-20.4400.7725.43614.150Kwei
TRON-30000Kwei
Ethereum1.1221.6088.46424.382Kwei

The conversion rates used for the example calculations are from the average rates of 10/11/2018. The conversion rates are as follows:

TRX to USD0.023
ETH to USD200
Kwei to USD0.2
ETH to TRX8695.7

# Tools

The following tools were used:

### TRON

##### Compile & Deploy:
  • [TronBox](🔗)

##### Converter:
  • <a href="https://tronscan.org/#/tools/tron-convert-tool" target="_blank">TRON convert tool</a>

### Ethereum

##### Compile & Deploy:
  • <a href="https://truffleframework.com/" target="_blank">Truffle Framework</a>

##### Converter:
  • <a href="https://etherconverter.online/" target="_blank">WEI2ETH</a>

  • <a href="http://ethdocs.org/en/latest/ether.html" target="_blank">Official Convert Rate</a>

# Small Contracts Examples

## SimpleStorage



**ByteCode:**



Byte Size: 444

### Create & Deploy Contract Cost

### TRON

  • **Total Fee Charged**: **3833820** sun _(3.834 TRX)_

  • Energy Usage: **0**

  • Energy Fee: **3833820** sun

  • Origin Energy Usage: **0** sun

  • Energy Usage Total: **38281**

  • Net Usage: **0**

  • Net Fee: **5720** sun

### Ethereum

  • **Total Gas Cost**: **1122130** Gwei _(0.00112213 ETH)_




## Fibonacci



**ByteCode**



Byte Size: 734

## Create & Deploy Cost

### TRON

  • **Total Fee Charged**: **6719410** sun _(6.719 TRX)_

  • Energy Usage: **0**

  • Energy Fee: **6711100** sun

  • Origin Energy Usage: **0** sun

  • Energy Usage Total: **67111**

  • Net Usage: **0**

  • Net Fee: **8310** sun

### Ethereum

  • **Total Gas Cost**: **1607850** Gwei _(0.00160785 ETH)_




# Medium Contract Example

Access the zombiefactory solidity file <a href="https://github.com/wxue/solidity-cryptozombies/blob/master/contracts/zombiefactory.sol" target="_blank">here</a>.

**ByteCode**



Byte Size: 4042

## Create & Deploy Cost

### TRON

  • **Total Fee Charged**: **47299680** sun _(47.3 TRX)_

  • Energy Usage: **0**

  • Energy Fee: **47272000** sun

  • Origin Energy Usage: **0** sun

  • Energy Usage Total: **472720**

  • Net Usage: **0**

  • Net Fee: **27680** sun

### Ethereum

  • **Total Gas Cost**: **8464150** Gwei _(0.00846415 ETH)_




# Large Contract Example

Access the zombieownership solidity file <a href="https://github.com/wxue/solidity-cryptozombies/blob/master/contracts/zombieownership.sol" target="_blank">here</a>.

**ByteCode**



Byte Size: 6078

## Create & Deploy Cost

### TRON

  • **Total Fee Charged**: **123117850** sun _(123.118 TRX)_

  • Energy Usage: **0**

  • Energy Fee: **123045800** sun

  • Origin Energy Usage: **0** sun

  • Energy Usage Total: **1230458**

  • Net Usage: **0**

  • Net Fee: **72050** sun

### Ethereum

  • **Total Gas Cost**: **24381820** Gwei _(0.02438182 ETH)_

# How much TRX is needed to freeze to be free to deploy on main net?

Below number got from a test on the date of 10/23/2018, which TotalEnergyWeight was 2,127,263.

The energy we can get from freezing 100 TRX is = (100/2127263)*50,000,000,0000 = 23504380.

Energy obtained = the TRX frozen for gaining Energy / the total TRX frozen for gaining Energy in the entire network * 50,000,000,000

Based such amount of frozen token pool size,

  • to deploy a small contract we need to freeze 2-2.5 TRX to be free;

  • for a medium contract, 5-20 TRX used to freeze would be enough to be free deploy;

  • for a large contract, the number would be around 50 TRX.

**Please notice that the energy obtains (energyLimit) is dynamic based on the totalEnergyWeight.**