Writing Smart Contracts Print

  • blockchaindigitalassets, blockchain, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Development practice.

WHAT LANGUAGES ARE USED

Purpose-built languages for the major networks, differing by platform.

WHAT MAKES DEVELOPMENT DIFFERENT

Every operation costs money Storage is extremely expensive Code is public Deployment is frequently permanent Errors are financial and immediate

WHAT THAT DEMANDS

Extreme care, and verification far beyond ordinary software.

WHAT TO MINIMISE

Storage use Computation Contract size

WHY STORAGE ESPECIALLY

It is the most expensive operation by a wide margin.

WHAT TO AVOID

Loops over unbounded collections Operations whose cost grows with usage Complex logic where simple suffices

WHY UNBOUNDED LOOPS ARE DANGEROUS

They eventually exceed the limit, making the function permanently unusable.

WHAT TO USE

Established, audited libraries for standard functionality.

WHY

Reimplementing token standards or access control invites known errors.

WHAT TO TEST

Every path Every failure Every access control check Behaviour at boundaries Behaviour under adversarial conditions

WHAT TO RUN

Automated analysis tools designed for contract code.

WHAT TO ARRANGE BEFORE DEPLOYING ANYTHING HOLDING VALUE

An independent audit.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot