Skip to content

A smart contract to handle a lease agreement between two parties.

Notifications You must be signed in to change notification settings

maxwalts/smart-tenant

Repository files navigation

smart-tenant

A smart contract to handle a lease agreement between two parties.

Rules

  • Parties can only negotiate the contract before it has been signed
  • Rent is paid at the very end of a month.
  • Contract closes after last rent payment or upon abort()

Organization

  • One tenant payable address
  • One landlord payable address
  • Property struct
  • Offer struct
  • CounterOffer struct
  • mapping balances to keep track of amount due

Functions

  • onlyTenant:

    • makeCounterOffer()
    • sign() - initializes the contract
    • paySD()
    • payRent()
  • onlyLandlord:

    • Constructor()
    • setProperty()
    • makeOffer()
    • abort()
    • extendContract()
  • Open:

    • view contract attributes with inherent getter functions

States

  • enum State{Unsigned, AwaitingDeposit, Active, Closed}
    • State.Unsigned: contract is awaiting an agreement between Offer and CounterOffer
    • State.AwaitingDeposit: tenant has signed but has not submitted a deposit
    • State.Active: the lease is active, rent is due at the end of every month
    • State.Closed: contract term has completed, or contract has been voided by the landlord.

Testing

Future

pull requests welcome!

About

A smart contract to handle a lease agreement between two parties.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published