---
title: "Smart Contract Rent on Hedera – Part 2: How to Pay"
id: "15784"
type: "post"
slug: "smart-contract-rent-on-hedera-part-2-how-to-pay"
published_at: "2023-01-13T19:16:00+00:00"
modified_at: "2025-12-08T18:47:49+00:00"
url: "https://hedera.com/blog/smart-contract-rent-on-hedera-part-2-how-to-pay/"
markdown_url: "https://hedera.com/blog/smart-contract-rent-on-hedera-part-2-how-to-pay.md"
excerpt: "Learn how you can get your contracts ready to make rent payments and avoid expiration"
taxonomy_category:
  - "Uncategorized"
taxonomy_post_tag:
  - "technical"
---

[Skip to content](#content)
blog

# Smart Contract Rent on Hedera – Part 2: How to Pay

January 13, 2023

![Ed Marquez](https://hedera.com//wp-content/uploads/2025/12/Headshot.jpeg)

Ed Marquez

Head of Developer Relations

***Smart contract expiry and auto renewal are currently disabled. Smart contracts will not be charged auto renewal fees or expire.***

~~Contracts will pay rent on Hedera starting in March 2023.~~ As covered in the [Part 1 article](https://hedera.com/blog/smart-contract-rent-on-hedera-is-coming-what-you-need-to-know)
, rent is the recurring payment required for contracts to remain active on the network and is comprised of auto-renewal and storage fees. This article shows how you can get your contracts ready to make rent payments and avoid expiration.

#### **Try It Yourself**

- Get a [Hedera testnet account](https://portal.hedera.com/register)
  - This portal acts like a faucet, giving you 10,000 test HBAR every 24 hours
  - If you’re new to Hedera, check out [these steps to setup your development environment](https://docs.hedera.com/hedera/getting-started/environment-set-up)

- Use [this Codesandbox](https://codesandbox.io/s/hedera-example-contract-rent-z5w8y7?file=/index.js) to try the example
  - Fork the sandbox
  - Remember to provide testnet account credentials in the .env file
  - Open a new terminal to execute index.js

- Get the [example code from GitHub](https://github.com/ed-marquez/hedera-example-contract-rent/blob/master/index.js)

#### **You Will Use These Tools**

- Hedera JavaScript SDK ([Documentation](https://docs.hedera.com/hedera/sdks-and-apis/sdks) )
- Solidity ([Documentation](https://docs.soliditylang.org/en/v0.8.17/) )
- Mirror node REST API ([Learn More](https://hedera.com/blog/how-to-look-up-transaction-history-on-hedera-using-mirror-nodes-back-to-the-basics) )
- Mirror node explorer ([HashScan](https://hashscan.io/#/mainnet/dashboard) )

#### **Goals:**

1. Understand the Rent Settings
2. Define How Rent Will Be Paid
  1. Pay Rent for New and Existing Contracts

#### **1. Understanding the Rent Settings**

Every entity on Hedera has the fields ***expirationTime***, ***autorenewPeriod***, and ***autorenewAccount***:

- The ***expirationTime*** is the date and time when the entity expires
- The ***autorenewPeriod*** is the number of seconds by which the entity expiration is extended each auto-renew event
- The ***autorenewAccount*** is the account that will pay for rent

These fields can be set during creation and changed anytime with an update transaction. The next section covers this in more detail with examples.

Check out [this answer](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#what-are-the-steps-in-the-renewal-process-and-what-happens-if-a-contract-doesnt-pay-rent)
 in the [rent Frequently Asked Questions (FAQ)](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#smart-contract-rent-frequently-asked-questions-faq)
 to see an overview of the renewal process.

#### **2. Defining How Rent Will Be Paid**

Smart contracts on Hedera can pay for rent in two ways: external funds or contract funds.

#### **2.1 Paying Rent from External Funds (autorenewAccount)**

To pay rent for a contract from external funds (another account or contract), specify the ***autorenewAccount*** field using .***setAutoRenewAccontId()***. You can specify this and other rent-relevant fields for newly deployed contracts (using [ContractCreateFlow()](https://docs.hedera.com/hedera/sdks-and-apis/sdks/smart-contracts/create-a-smart-contract#contractcreateflow)
  
 or [ContractCreateTransaction()](https://docs.hedera.com/hedera/sdks-and-apis/sdks/smart-contracts/create-a-smart-contract#contractcreatetransaction)
) and for existing contracts (using [ContractUpdateTransaction()](https://docs.hedera.com/hedera/sdks-and-apis/sdks/smart-contracts/update-a-smart-contract)
).

The sample function in the first tab below deploys a new contract that will be renewed by the account specified in the variable ***autorenewAcc***. Note that the key for that account (***autorenewAccKey***) must sign the contract creation transaction. If you specify an admin key for the contract, that key must sign the transaction as well (***cAdminKey***). You also have the option to use ***.setAutoRenewPeriod()*** if you wish to specify that property for the contract. Valid renewal windows are between 30 and 92.5 days – a default of 30 days (7,776,000 seconds) is used if a value is not specified.

The function in the second tab updates an existing contract. An admin key must be specified during contract creation for a contract to be mutable. The function updates the ***autorenewPeriod*** for the contract from the default of 30 days to the maximum possible value of 8,000,001 seconds (or 92.5 days).

You can see an example that uses these functions in [index.js](https://github.com/ed-marquez/hedera-example-contract-rent/blob/master/index.js)
  
 in this [GitHub repository](https://github.com/ed-marquez/hedera-example-contract-rent)
. Below is the console output of that index.js file.

**Console Output:**

```
STEP 1 ===================================
- Creating Alice's account...
```

```
- Alice's account: https://hashscan.io/testnet/account/0.0.49297924
 
STEP 2 ===================================
```

```
- Deploying contract autorenewed by Alice...
- Contract ID: 0.0.49297928
```

```
- Contract ID in Solidity address format: 0000000000000000000000000000000002f03a08
- Get details from mirror node:
```

```
- REST API: https://testnet.mirrornode.hedera.com/api/v1/contracts/0.0.49297928
- Explorer: https://hashscan.io/testnet/contract/0.0.49297928
```

```
 
STEP 3 ===================================
- Updating contract's autorenew period to 92.5 days...
```

```
- Contract update status: SUCCESS
- Get details from mirror node:
```

```
- REST API: https://testnet.mirrornode.hedera.com/api/v1/transactions/0.0.2520793-1673634517-367346598
- Explorer: https://hashscan.io/testnet/transaction/1673634526.399625003?tid=0.0.2520793-1673634517-367346598
```

```
 
====================================================
  THE END - NOW JOIN: https://hedera.com/discord
```

```
===================================================
```

#### **2.2 Paying Rent from Contract funds**

If the ***autorenewAccount*** is null, invalid, or has an empty balance, then the entity will try to pay for the auto-renew itself (if the entity is an account or smart contract containing HBAR).

If the contract will pay for its own rent, then it needs to be able to hold and receive HBAR. These two tutorials show how you can send HBAR to contracts using the Hedera SDKs and Solidity:

- [How to Send and Receive HBAR Using Smart Contracts – Part 1: Using the SDK](https://hedera.com/blog/how-to-send-and-receive-hbar-using-smart-contracts-part-1-using-the-sdk)
- [How to Send and Receive HBAR Using Smart Contracts – Part 2: Using Solidity](https://hedera.com/blog/how-to-send-and-receive-hbar-using-smart-contracts-part-2-solidity)

With the SDK, you can simply do a [TransferTransaction()](https://docs.hedera.com/hedera/sdks-and-apis/sdks/cryptocurrency/transfer-cryptocurrency)
  
 to send HBAR to contracts – this doesn’t require having *payable*  
 functions or *receive()* or *fallback()* functions. This approach is simple and could be suitable if you want to enable users of your contracts to easily make donations.

With Solidity, you can send HBAR to your contracts with ***fallback()***, ***receive()***, or ***payable*** functions. The ***transfer***, **send**, and **call** methods also work. These options can help you implement a funding approach for your contracts that is fee-based – whether it’s a fixed or dynamic fee, [this article](https://hedera.com/blog/smart-contract-rent-is-coming-to-hedera)
 explores some of those ideas.

[This answer](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#who-pays-for-the-contracts-renewal-and-storage-fees)
 in the [rent Frequently Asked Questions (FAQ)](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#smart-contract-rent-frequently-asked-questions-faq)
 also covers how rent is paid for all scenarios involving external and/or contract funds.

#### **Summary**

Now you know how to pay rent for newly deployed and existing smart contracts on Hedera. With the approaches covered in this article, you can implement various ways to fund your contracts, from donation-based to fixed or dynamic fees.

#### **Continue Learning**

- [Documentation – Smart Contract Rent: Auto Renewal and Storage](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#smart-contract-rent-auto-renewal-and-storage)
- [Documentation – Smart Contract Rent: Frequently Asked Questions (FAQ)](https://docs.hedera.com/hedera/core-concepts/smart-contracts/gas-and-fees#smart-contract-rent-frequently-asked-questions-faq)
- [Open a Testnet Account](https://portal.hedera.com/register)
- [Try Examples](https://docs.hedera.com/hedera/tutorials) and [Tutorials](https://docs.hedera.com/hedera/tutorials)
- [Join the Developer Discord](http://hedera.com/discord)
- [Read the Learning Center](https://hedera.com/learning)

[Back to Blog](/blog)

discover

See more articles

[View All](/blog)

![Image](https://hedera.com/wp-content/uploads/2026/08/Regulation_Blog-1024x576.png)

August 5, 2026

### Details decide. What digital asset policy did in July 2026

Halfway through 2026, the regulatory picture is coming into focus. Hedera Chief Policy Officer Nilmini Rubin and VP Global Policy Isadora Arredondo break down what moved in June across the

[Read More](https://hedera.com/blog/details-decide-what-digital-asset-policy-did-in-july-2026/)

![Deploy Multichain Dapps](https://hedera.com/wp-content/uploads/2026/07/HH600301_DeployMultichainDapps_Final-1024x576.png)

July 17, 2026

### Deploy Multichain Dapps on Hedera in 60 Seconds with scaffold-hbar

Deploying multichain dapps on Hedera has never been easier! With just one command, you can spin up a fully functional dapp using Next.js, Hardhat or Foundry, and AI agent context…

[Read More](https://hedera.com/blog/deploy-multichain-dapps-on-hedera-in-60-seconds-with-scaffold-hbar/)

![Regulation is finding its form](https://hedera.com/wp-content/uploads/2026/07/Regulation_Blog-1-1024x576.png)

July 13, 2026

### Regulation is finding its form in summer 2026

Halfway through 2026, the regulatory picture is coming into focus. Hedera Chief Policy Officer Nilmini Rubin and VP Global Policy Isadora Arredondo break down what moved in June across the

[Read More](https://hedera.com/blog/regulation-is-finding-its-form-in-summer-2026/)

## Ready to get started?

Discover why Hedera is the trusted institutional-grade network powering the new digital economy.

[Start Building](/start-building)

[Contact](/contact)

We use cookies to deliver the best experience on our website and to analyze traffic. By continuing to use this site, you consent to our cookie policy.

Review our [Privacy Policy](/privacy)
 to understand how Hedera collects and uses information.

Accept All CookiesAccept Necessary Cookies
