Contract-Oriented Programming

by Peter Borah

(peterborah@gmail.com)

Alpha available:

https://github.com/ConsenSys/dao-wars

Contracts are

a new abstraction

Permanent

Public

New abstractions,

new practices

Expose Your Data

Principle 1:

Bad:

Good:

Good:

Don't Discriminate

(use msg.sender)

Principle 2:

Bad:

What if the contributer is this?

Good:

Keep Contracts Small

Principle 3:

Bad:

Bad (cont.):

Good:

:

Good (cont.):

:

Separate Logic and Data

(if you want to update it later)

Principle 4:

Bad?

Better?

Better?

An Extreme Example

Trustlessness is always an option

The Principles

  • Expose Your Data
  • Don't Discriminate (use msg.sender)
  • Keep Contracts Small
  • Separate Logic and Data

Contact me:

peter.borah@gmail.com

 

Slides available at:

https://slides.com/peterbb/contract-oriented

Contract-oriented Programming

By peterbb

Contract-oriented Programming

  • 5,543